// NeoPixel Ring simple sketch (c) 2013 Shae Erisson

// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel l
ibrary
// Adapted for the Attiny85 by Luc Volders
// First we set all leds to blue
// next one led will change from blue to red and back to blue
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>
// The neopixels will be attached to pin 1
#define PIN
1
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS
7
// 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 parame
ter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ80
0);
int delayval = 500; // delay for half a second
void setup() {
randomSeed(analogRead(0));
pixels.begin(); // This initializes the NeoPixel library.
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, 0,0,255);
pixels.show();
delay(delayval*2);
}
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up t
o the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, 255,0,0);
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
pixels.setPixelColor(i, 0,0,255);
delay(delayval);
}
}