Created
December 15, 2020 19:15
-
-
Save cbscribe/78c8f18281653ab9cdf2fbcbd9e24946 to your computer and use it in GitHub Desktop.
NeoPixel example code - Lights up the string in two different colors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#define LED_PIN 2 | |
#define NUM_LEDS 12 | |
Adafruit_NeoPixel pixels(NUM_LEDS, LED_PIN, | |
NEO_GRB + NEO_KHZ800); | |
void setup() | |
{ | |
pixels.begin(); | |
} | |
void loop() | |
{ | |
for (int i = 0; i < NUM_LEDS; i++) | |
{ | |
pixels.setPixelColor(i, pixels.Color(110, 255, 0)); | |
pixels.show(); | |
delay(100); | |
} | |
for (int i = 0; i < NUM_LEDS; i++) | |
{ | |
pixels.setPixelColor(i, pixels.Color(255, 255, 10)); | |
pixels.show(); | |
delay(100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment