Skip to content

Instantly share code, notes, and snippets.

@ulrichzwingli
Created September 23, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ulrichzwingli/9be4cdf777bd78fbe063a7a64758ac7b to your computer and use it in GitHub Desktop.
Save ulrichzwingli/9be4cdf777bd78fbe063a7a64758ac7b to your computer and use it in GitHub Desktop.
Physical_computing_lightUp3Leds
// to illuminate 3 leds
int ledArray[ ] = {2,4,7};
void setup() {
for(int i = 0, i < 3, i++) {
pinMode(ledArray[i], OUTPUT);
}
}
void loop() {
// put your setup code here, to run once:
lightup();
}
void lightup() {
// put your main code here, to run repeatedly:
for(int j = 0, j <= 2, j++) {
digitalWrite(ledArray[j], HIGH);
delay(1000);
}
for(int k = 2, k >= 0, k--) {
digitalWrite(ledArray[k], LOW);
delay(1000);
}
}
@ericjforman
Copy link

This code looks fine, other than your comments being in the wrong section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment