Created
March 13, 2019 13:03
-
-
Save ringodin/71ad77d24bbbeea21b90ae4208ad6ee0 to your computer and use it in GitHub Desktop.
This turns all 8 on at once, and off at once
This file contains 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> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
//what's the info pin? | |
#define PIN 6 | |
// How many NeoPixels are attached to the Arduino? | |
#define NUMPIXELS 8 | |
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. | |
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest | |
// example for more information on possible values. | |
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); | |
int delayval = 500; // delay for half a second | |
void setup() { | |
pixels.begin(); // This initializes the NeoPixel library. | |
} | |
void loop() { | |
pixels.setPixelColor(0, pixels.Color(50,0,50)); | |
pixels.setPixelColor(1, pixels.Color(50,0,50)); | |
pixels.setPixelColor(2, pixels.Color(50,0,50)); | |
pixels.setPixelColor(3, pixels.Color(50,0,50)); | |
pixels.setPixelColor(4, pixels.Color(50,0,50)); | |
pixels.setPixelColor(5, pixels.Color(50,0,50)); | |
pixels.setPixelColor(6, pixels.Color(50,0,50)); | |
pixels.setPixelColor(7, pixels.Color(50,0,50)); | |
pixels.show(); | |
delay(500); | |
pixels.setPixelColor(0, pixels.Color(0,0,0)); | |
pixels.setPixelColor(1, pixels.Color(0,0,0)); | |
pixels.setPixelColor(2, pixels.Color(0,0,0)); | |
pixels.setPixelColor(3, pixels.Color(0,0,0)); | |
pixels.setPixelColor(4, pixels.Color(0,0,0)); | |
pixels.setPixelColor(5, pixels.Color(0,0,0)); | |
pixels.setPixelColor(6, pixels.Color(0,0,0)); | |
pixels.setPixelColor(7, pixels.Color(0,0,0)); | |
pixels.show(); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment