Neopixel
We can set the brightness of a single color of LED using the analogWrite() function. How can we control a full color RGB LED, or a lot of LEDs, without using all the pins of the Huzzah32? A Neopixel is a brand of WS2812B RGB LEDs that can be controlled with a single pin, and chained so that a whole strip can be controlled individually for brightness and color, still using just one pin. Neopixels can be purchased individually, on long strands, and in all kinds of arrays of shapes.
Wire the Neopixel
The Neopixel board in the kit takes 5V, ground, and any pin for DIN (I used pin 5). The other end of the board has pads to solder connections to the next set of Neopixels, connecting DOUT to the next DIN. I have pre-soldered header pins on so you can plug the board into your breadboard.
Get the library
The Arduino IDE does not come with the code that the Huzzah32 needs to control the Neopixels, so you need to download and add it from an external library. INSTRUCTIONS FOR FASTLED
Run the example code
The Huzzah32 can drive many, many Neopixels, but we have only 8, so we need to change the example code to match. Change numPins to 1, edit the array pinList to just the number of the pin you are using for DIN, and change ledsPerStrip to 8. Run the code and the LEDs should flash through a variety of bright colors.
The Neopixels can be harshly bright, so I like to put something over them to diffuse the color, like a sheet of white paper, tissue, or cotton.
The code boils down to the ability to set the color of each LED individually using leds.setPixel(), and then telling all of the LEDs to update at the same time using leds.show().
Take a look at this sample code to see how to flash all the LEDs red, then green, then blue:
Set the brightness and color of each LED
You can also specify the raw RGB value of each LED. In this example, the value of the pot determines how bright white the entire strip of LEDs are: