Created
March 23, 2017 13:53
-
-
Save ljahier/478388bfbadba279029c42790bb3fd86 to your computer and use it in GitHub Desktop.
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 buttonState; | |
int buttonStateTwo; | |
int my_time; | |
void setup() { | |
// put your setup code here, to run once: | |
for (int thisPin = 2; thisPin < 5; thisPin++) { | |
pinMode(thisPin, OUTPUT); | |
} | |
pinMode(6, INPUT); | |
pinMode(7, INPUT); | |
pinMode(A0, INPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
my_time = analogRead(A0); | |
buttonState = digitalRead(6); | |
buttonStateTwo = digitalRead(7); | |
if (buttonState == HIGH) | |
{ | |
// | |
for (int thisPin = 5; thisPin >= 2; thisPin--) { | |
// turn the pin on: | |
digitalWrite(thisPin, HIGH); | |
delay(my_time); | |
// turn the pin off: | |
digitalWrite(thisPin, LOW); | |
} | |
} | |
if (buttonStateTwo == HIGH) | |
{ | |
for (int thisPin = 2; thisPin <= 5; thisPin++) { | |
// turn the pin on: | |
digitalWrite(thisPin, HIGH); | |
delay(my_time); | |
// turn the pin off: | |
digitalWrite(thisPin, LOW); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment