Skip to content

Instantly share code, notes, and snippets.

@gallaugher
Created May 9, 2021 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gallaugher/147a43162d72580e99754b216d2b880b to your computer and use it in GitHub Desktop.
Save gallaugher/147a43162d72580e99754b216d2b880b to your computer and use it in GitHub Desktop.
Simple Red LED Strip
#include <Adafruit_NeoPixel.h>
//RgbColor BLACK(0, 0, 0);
//RgbColor RED(128, 0, 0);
#define LED_PIN 12
#define LED_COUNT 9
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
uint32_t red = strip.Color(255, 0, 0);
int led = 12; // the pin the LED is connected to
void setup() {
pinMode(led, OUTPUT); // Declare the LED as an output
}
void loop() {
strip.begin();
strip.fill(red);
strip.show(); // Initialize all pixels to 'off'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment