Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Adafruit_NeoPixel.h>
- #ifdef __AVR__
- #include <avr/power.h>
- #endif
- #define PIN 21
- #define NUMPIXELS 24
- Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
- void setup() {
- #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
- clock_prescale_set(clock_div_1);
- #endif
- pixels.begin();
- }
- void loop() {
- int r = random(0, 256);
- int g = random(0, 256);
- int b = random(0, 256);
- for(int i = 0; i < NUMPIXELS; i++) {
- pixels.setPixelColor(i, pixels.Color(r, g, b));
- pixels.show();
- delay(50);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement