Addressable RGB LED strips are available in many shapes and sizes to add color and illumination to Arduino projects.
Strips of a few to hundreds of LEDs
Shorter "sticks," "rings," and other shapes of 8 to 20 LEDs
With only one data connection per strip, each LED "pixel" can be controlled in 256 levels of red, green, and blue. (Plus power and ground connections.)
The software that generates the data signal to control addressable LEDs is complex, but Codecraft and Arduino make this very easy to use!
Review Adafruit's "The Magic of NeoPixels"
Get your parts ready:
Grove cable
Connect one end of the Grove cable to the LED strip and the other end to the Grove Beginner Kit connector labeled D7.
Codecraft includes two blocks to control RGB LED strips. One of them controls all the LEDs at one time and the other controls a specific LED via the "Number" parameter.
Create a Codecraft sketch to explore turning the LEDs on and off and changing the colors.
Create a Codecraft sketch that uses the LED strip as a bargraph to display one of the input modules (rotary potentiometer, light sensor, sound, temperature, humidity, accelerometer, ...)
If you're stuck, here's an example sketch:
RGB_LED_strip_demo.cdc
If you attempt to connect an RGB LED Strip and a servo at the same time, expect the servo to operate strangely. It will "chatter" and move small amount even when it should be idle.
The reason is that the underlying implementations of RGB LED Strip and Servo use resources that conflict.
Here's a discussion about this from Adafruit, who developed the NeoPixel Arduino library:
https://learn.adafruit.com/neopixels-and-servos/overview
Codecraft supports 2 RGB LED Strips, but not 3 or more.
RGB LED strips can be connected together to appear as a single longer strip to get around this problem.
There are several Arduino libraries you can consider to use to control the RGB LED strip.
Codecraft uses the popular Adafruit "NeoPixel" library to implement the "RGB LED Strip" blocks.
Review the Sparkfun Addressable LED Strip Hookup Guide.
Experiment with one of the NeoPixel example sketches such as "strandtest."
(File ... Examples ... Adafruit NeoPixel ... strandtest)
Modify this code to match our LED and connection:
#define LED_PIN 7
#define LED_COUNT 8
Create an Arduino sketch that uses the RGB LED strip, perhaps adding on to one of your existing projects.