Skip to content

Commit

Permalink
No animation
Browse files Browse the repository at this point in the history
  • Loading branch information
McZonk committed Sep 16, 2012
1 parent 63c77e0 commit adb0d0a
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions RGBStrip.ino
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,9 @@ void loop()
}

void ledUpdate() {
static int animation = 0;
animation += 1;
animation %= LedStripLedCount;

for(int i = 0; i < 56; ++i) {
for(int i = 0; i < LedStripLedCount; ++i) {
HSBColor currentColor = currentColors[i];

if(animation == i) {
currentColor.b = (currentColor.b * 256) >> 8;
} else if((animation+1)%LedStripLedCount == i || (animation+LedStripLedCount-1)%LedStripLedCount == i) {
currentColor.b = (currentColor.b * 192) >> 8;
} else if((animation+2)%LedStripLedCount == i || (animation+LedStripLedCount-2)%LedStripLedCount == i) {
currentColor.b = (currentColor.b * 128) >> 8;
} else if((animation+3)%LedStripLedCount == i || (animation+LedStripLedCount-3)%LedStripLedCount == i) {
currentColor.b = (currentColor.b * 64) >> 8;
} else {
currentColor.b = 0;
}


RGBColor rgbColor = currentColor;

ledStrip.setPixelColor(i, GammaCorretion(rgbColor.r), GammaCorretion(rgbColor.g), GammaCorretion(rgbColor.b));
Expand Down

0 comments on commit adb0d0a

Please sign in to comment.