Bluetooth Low Energy (BLE) Arduino Nano [BLE Nano] being controlled by the BLExAR iOS app form an iPhone. The iPhone uses simple input numbers to turn an RGB LED on and off via Bluetooth.
Full tutorial at: makersportal.com/blog/2020/4/17/ble-nano-arduino-c…
The BLE Nano shown in this video is a hybrid between an Arduino Nano and a CC2540 Bluetooth Low Energy (BLE) module. The Arduino Nano has an ATmega328P as its main microprocessor, which communicates over the serial port to send and receive Bluetooth packets from the CC2540 BLE chip. This creates a Bluetooth-enabled Arduino device - encased in a Nano-sized circuit board! Using the BLExAR iOS app, the BLE-Nano will be controlled using an iPhone. BLExAR allows users to control the pins on the Nano, which will be demonstrated by switching an RGB LED on and off, and using the PWM capabilities of the ATmega328P to dim and brighten the RGB LED. The BLE Nano is, for the most part, entirely an Arduino Nano board, with the exception that it uses its serial port to communicate with the CC2540 BLE module. The wiring, upload method, and control codes will all be given as part of this tutorial, such that users can follow along directly with the project.
The BLE Nano uses the universal asynchronous receiver-transmitter (UART) communication protocol to communicate between the ATmega328P microcontroller and the CC2540 Bluetooth module. In short, the BLE Nano uses its serial port to send and receive information to and from other BLE-enabled devices from its CC2540 chip. Thus, in this section, the codes will be focused on serial communication with the Nano board to receive commands. The commands are received as 8-bit Unicode Transformation Format (UTF-8) characters, which we will decode as letters and numbers. These letters and numbers will help us decipher how the BLE Nano will be controlled. For example, in the code below, pins D2 - D13 are allocated as outputs on the Nano board. In the continuous loop, the BLE Nano waits for a number to be inputted (from 2-13); then, this number is taken as the pin to control. Lastly, the pin is changed based on its current state, i.e. if the pin is on, it turns off; and if the pin is off, it turns on.
The BLExAR app allows serial communication between the BLE Nano and an iOS device (iPhone or iPad). The BLExAR app was designed by our team specifically for reasons such as this - to interface between an iPhone and Arduino board.
Download the BLExAR app here: apps.apple.com/us/app/blexar/id1439459314
コメント