Bluetooth Controlled NeoPixels

This particular sketch for the Arduino allows you to change the color of the NeoPixel LEDs and trigger animations using the Adafruit Bluefruit LE Connect app for iOS or Android.

Once you get this working, you can connect the lamp to the Internet thru your phone by using our MQTT gateway capability of Bluefruit Connect - for more details check out this tutorial for details.

Arduino Libraries

To use the Adafruit Feather 32u4 BLE sketch you'll want to make sure you're using the latest version of the Arduino IDE (1.6.5 at the time of this writing).

If you're totally new to Arduino take a little time to go through some introductory tutorials like how to make a LED blink.  This will help you understand how to use the IDE, load a sketch, and upload code.

Next you'll need to make sure the libraries used by the sketch are installed.  With the latest Arduino IDE you can use its library manager to easily install libraries, or check out this guide on how to manually install a library.  You'll want to install the following libraries:

  • Adafruit BluefruitLE nRF51
  • Adafruit NeoPixel

Search for the libraries in the library manager and they should be easy to find and install.

Adafruit AVR Boards

Next, you'll need to install the Adafruit AVR boards package from the Boards Manager. Open the Boards Manager and search for Adafruit AVR. This includes all of the boards from Adafruit and will make Arduino compatabile with them. The  BLE sketch was tested with version 1.4.0.

All this is covered in the Bluefruit Feather tutorial guide!

Uploading Sketch to Adafruit Feather BLE

This sketch will run the Bluetooth controlled LED program to the NeoPixel strips that are mounted in the lamp

To load the sketch make sure the libraries above are installed, and the Arduino is connected to the computer through a USB cable.  Under the Tools -> Board menu make sure the Adafruit Feather 32u4 is selected, and under the Tools -> Port menu the serial port for the Adafruit Feather is selected.  

Then press the upload button or click the Sketch -> Upload item to send the code to the Arduino.  Woo-hoo the sketch should be running.

Connect Adafruit BLE Mobile App to Adafruit Feather BLE

Download the Adafruit BLE Connect app for iOS or Android. Under the peripherals list, tap the connect button on the Adafruit Bluefruit LE item. Make sure the Feather board is powered on. Select "Controller" and choose either Control Pad or the Color Picker.

Control Pad

Buttons 1-4 will trigger an animation.

  1. larsonScanner
  2. color wipe
  3. rainbow gradient
  4. rainbow cycle

Color Picker

Here you can change the brightness or RGB value of the leds. 

Uploaded Code

With the Arduino sketch uploaded to the Adafruit Feather 32u4 Bluefruit LE, proceede to the circuit digram page for prototyping the circuit.

This guide was first published on Feb 18, 2016. It was last updated on 2016-02-18 09:05:02 -0500.

This page (Software) was last updated on Feb 14, 2016.

Text editor powered by tinymce.