PROJECT: Using Entire Strip
Step 1 - Build the Project

Entire LED Strip Demo Hookup: LED Strip with Red in 5V, Green in 13, Blue in 12, Black in ground.

Topics Covered:

 

Turn on a every pixel on your LED strip. Play around with the different color values with .setPixel().

Step 2 - Upload the Code

/* *Shows the use of the all() function to illuminate all pixels on * the LED strip at once * * *The mix of the colors and their values from 0-300 is shown on the graph: * * |b r g b * |\ /\ /\ / * | \ / \ / \ / * | X X X * | / \ / \ / \ * |/___\/___\/___\__ * 0 100 200 300 * Each color has a line that zig-zags from low brightness * The color value of 150 is an equal mix between red & green * The color value of 100 is pure red */ #include "LEDStrip.h" /* * Make the LED strip object LEDStrip strip * = LEDStrip(numPixels, dataPin (DI), clockPin(CI)); */ LEDStrip strip = LEDStrip(15, 13, 12); void setup() { } void loop() { //Set all pixels to the color value 200. Colors range from 0-300 strip.setPixel(strip.ALL,200); strip.draw(); //Draw the .setPixel values to the strip } // (c) 2017 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense
 

Step 3 - Read the Walkthrough

First include the LEDStrip library. This library gives you access to a new set of commands (called methods) that make using the LED Strip easier. Without including the library, the Arduino software won’t recognize the new methods.

To tell the library the name & attributes of your LED Strip, you create an object. In this case, the object is called ‘strip’ and it has 15 pixels, the data pin is number 13, and the clock pin is number 12 on your carrier board.

In the loop, use the .setPixel() method to tell the strip which pixel to light (all of them) and what color to make that pixel.

The strip.draw() command sends the setPixel values to the strip so you can see them.

 

Use this color wheel as a reference for which values in your code will create a certain color. Experiment to find just the right hue!

Color wheel for using the Let's Start Coding LED Strip. A color value of 1 is blue, 50 is pink, 100 is red, 150 is yellow, 200 is green, 250 is cyan, and 299 is back to blue. 300 is white.