Created
September 30, 2015 14:34
-
-
Save arielchuri/ea0b1c0b5629826d3a1e to your computer and use it in GitHub Desktop.
The 100 LEDs without all of the serial printing so you can see how simple it is.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int leds[100]; | |
int ledCount = 100; | |
int blinkFactor = 1; | |
void setup() { | |
Serial.begin(9600); | |
for (int blinkFactor = 1; blinkFactor <= 100; blinkFactor++) { | |
for (int thisLed = blinkFactor - 1; thisLed < ledCount; thisLed += blinkFactor) { | |
if (leds[thisLed] == 0) { | |
leds[thisLed] = 1; | |
} else { | |
leds[thisLed] = 0; | |
} | |
} | |
} | |
for (int thisLed; thisLed <= ledCount; thisLed++) { | |
if (leds[thisLed] == 1) { | |
Serial.print(thisLed + 1); | |
Serial.print(" "); | |
} | |
} | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment