Added some comments

This commit is contained in:
Lukas Bachschwell 2015-12-03 12:11:18 +01:00
parent 1e507bf334
commit 9d6ebfba95

View File

@ -3,10 +3,14 @@
#include <avr/power.h> #include <avr/power.h>
#endif #endif
//Important: Set the number of LEDs here!!!
#define PIN 6 #define PIN 6
#define NUMPIXELS 22 #define NUMPIXELS 22
//Create the object representation of our strip
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
//Some usefull variables and buffers, currently not all in use
unsigned long previousMillis = 0; unsigned long previousMillis = 0;
unsigned long interval = 0; unsigned long interval = 0;
int mode = 0; int mode = 0;
@ -27,14 +31,13 @@ void setup() {
void loop() { void loop() {
interval = 100;
if(element<NUMPIXELS) if(element<NUMPIXELS)
element++; element++;
else else
element = 0; element = 0;
for(int i = 0; i < NUMPIXELS; i++){ for(int i = 0; i < NUMPIXELS; i++){
//Set the color values for all leds as pixels.Color(G,R,B);
pixels.setPixelColor(i,pixels.Color(((i==element)?255 :0),((i==element)?0:0),((i==element)?0:255))); // Moderately bright green color. pixels.setPixelColor(i,pixels.Color(((i==element)?255 :0),((i==element)?0:0),((i==element)?0:255))); // Moderately bright green color.
} }
@ -44,6 +47,7 @@ void loop() {
else pixels.setPixelColor(i,pixels.Color(255,0,0)); else pixels.setPixelColor(i,pixels.Color(255,0,0));
} }
*/ */
//this sends the data from our object to the actuall strip
pixels.show(); pixels.show();
delay(200); delay(200);
} }