NeoPixel LED Strip

Liam Brady

LED Strips are individually addressable ribbons of RGB (red green blue) lights, meaning that each light on the ribbon can be controlled by itself and give off any color on the visible color spectrum. Every light on the strip has its own chip onboard that processes commands given to it by the Arduino.


#include <FastLED.h>
#define NUM_LEDS 15
#define DATA_PIN 6

CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}

void loop() {
  

leds[0] = CRGB::Red; 

        FastLED.show(); 

        delay(30); 

}

#include <FastLED.h>

#define PIN 10

#define NUM_LEDS 15


CRGB leds[NUM_LEDS];


void setup() {

  // put your setup code here, to run once:

  FastLED.addLeds<NEOPIXEL, PIN>(leds, NUM_LEDS);

}


void loop() {


  int potPin = analogRead(A0);


  int pixelPos = map(potPin,0,1024,0, NUM_LEDS);


  for (int dot = 0; dot < pixelPos; dot++) {

    leds[dot] = CHSV( 255, 255, 255);

    FastLED.show();

    // clear this led for the next time around the loop

    leds[dot] = CRGB::Black;

  }

}