Skip to content

Commit

Permalink
Changed the loop iteration variable in all examples to uint16_t to ma…
Browse files Browse the repository at this point in the history
…ke it easier for people with more than 254 LEDs.
  • Loading branch information
DavidEGrayson committed Jan 7, 2014
1 parent e299220 commit 31eeaac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void loop()
color.blue = Serial.parseInt();

// Update the colors buffer.
for(byte i = 0; i < LED_COUNT; i++)
for(uint16_t i = 0; i < LED_COUNT; i++)
{
colors[i] = color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void loop()
{
// Update the colors.
byte time = millis() >> 2;
for(byte i = 0; i < LED_COUNT; i++)
for(uint16_t i = 0; i < LED_COUNT; i++)
{
byte x = time - 8*i;
colors[i] = (rgb_color){ x, 255 - x, x };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void loop()
{
// Update the colors.
uint16_t time = millis() >> 2;
for(byte i = 0; i < LED_COUNT; i++)
for(uint16_t i = 0; i < LED_COUNT; i++)
{
byte x = (time >> 2) - (i << 3);
colors[i] = hsvToRgb((uint32_t)x * 359 / 256, 255, 255);
Expand Down

0 comments on commit 31eeaac

Please sign in to comment.