Introduction: LinkIt One : AT Commands Over Bluetooth SPP
In this instructable, I'll be discussing how to use Bluetooth SPP for LinkIt One to work as a AT interface to the development board.
In short, you can try these commands through Bluetooth to LinkIt One and can get reponse
- AT+GET_BATTERY : Read battery charge, and charging status
- AT+GET_ANALOG : Read analog pin values
- AT+SET_LED<0> : Set LED at pin 13 to OFF
- AT+SET_LED<1> : Set LED at pin 13 to ON
Step 1: Add AT_CMD_arduino Library to Arduino IDE
Follow these steps :
- Goto https://github.com/loovee/AT_CMD_Arduino
- Download the ZIP file
- In Arduino IDE, goto Sketch -> Add LIbrary -> Add .ZIP Library
- Browse to downloaded ZIP file and click OK
This will install the library to your arduino IDE
Step 2: Sketch You LinkIt One
Please find the complete sketch attached.
- In setup(), we are initializing BL SPP interface and setting the AT command sets
- In loop(), we are continuously monitoring for AT commands through BL SPP interface.
- Other three function - setLed(), getBattery(), getAnalog() - provides the handlers for related AT commands
Step 3: Installing Android App and Testing
To test the sketch, install Bluetooth SPP tools Pro from https://play.google.com/store/apps/details?id=mobi...
- Now unpair your LinkIt One, if you have already paired it with your phone.
- Goto Bluetooth SPP tools Pro, scan for devices.
- Select your LinkIt One device once it's shown in the list.
- Click to Pair and then Connect
- Use 'Command Line Mode' and select '\r\n' as delimiter.
- Now you will be able to send AT commands to your LinkIt One
Currently the following commands are supported :
A demo video is attached.