Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // NeoPixel Ring simple sketch (c) 2013 Shae Erisson
- // Released under the GPLv3 license to match the rest of the
- // Adafruit NeoPixel library
- #include <Adafruit_NeoPixel.h>
- #define PIN 6 // On Trinket or Gemma, suggest changing this to 1
- #define NUMPIXELS 16 // Popular NeoPixel ring size
- #define BRIGHNESS 100 //brighness on a scale of 0-255
- Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
- void setup() {
- pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
- pixels.setBrightness(100);
- }
- void loop() {
- //for (int i = 0; i < NUMPIXELS; i++) { // For each pixel...
- pixels.setPixelColor(0, pixels.Color(255, 0, 0));
- pixels.show(); // Send the updated pixel colors to the hardware.
- delay(1000); // Pause before next pass through loop
- pixels.setPixelColor(1, pixels.Color(0, 255, 0));
- pixels.show(); // Send the updated pixel colors to the hardware.
- delay(1000); // Pause before next pass through loop
- pixels.setPixelColor(2, pixels.Color(0, 0, 255));
- pixels.show(); // Send the updated pixel colors to the hardware.
- delay(1000); // Pause before next pass through loop
- pixels.clear();
- delay(1000);
- //}
- //pixels.clear(); // Set all pixel colors to 'off'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement