Firmata is a light weight protocol that was designed to make it possible to control an Uno from a variety of external devices, such as you laptop using another programming language. We've ported Firmata over to BLE using our Adafruit_BLE_UART as the transport layer, and created an easy to use IDE to help you get started with it.
The first thing you'll need to do is download the Adafruit_BLE_PinIO repository from Github, and install it in your Arduino libraries folder (ex.: libraries/Adafruit_BLE_Pin_IO) just like you did with Adafruit_nRF8001. Download and unzip the library, rename the folderAdafruit_BLE_Pin_IO making sure that it contains Adafruit_BLEFirmata.cpp and .h Then install that into your libraries folder
The Adafruit_PinIO sketches also requires Adafruit_nRF8001 to be present in your libraries folder but you already installed that so you should be good to go if you went through the UART echo tests.
Once this library is installed, open up the StandardFirmata sketch (File > Examples > Adafruit_BLEFirmata > StandardFirmata), compile the sketch, and program the Uno with your firmware.
The Firmata BLE app demo allows you to some basic functionality with your Arduino, great for testing out ideas or sensors
- Digital Input (e.g. switches)
- Digital Output (e.g. relays)
- Analog Input (e.g. sensors)
- PWM Output (e.g. LED dimming)
- Connect a standard LED (any color) with a inline resistor (220-1K is fine) to Digital 7
- Connect an RGB LED (either common cathode or anode) so that the red, green and blue LED pins tie to Digital 3 5 and 6 with inline resistors. If using common anode, connect the fourth pin to 5V. If using common cathode, connect it to GND.
- Connect a switch of some sort to Digital 4 so that when pressed, it connects to ground. No pullup resistor is required
- Connect a potentiometer (any value 500 ohm to 1Mohm) so that the two outer legs connect to 5V and GND and the middle pin connects to Analog 5