Created
September 14, 2015 05:51
-
-
Save dean-shaff/91e151b0035816312278 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
void loop() { | |
randNumber1 = random(0,100); | |
randNumber2 = random(0,100); | |
int bigger; | |
if (randNumber1 > randNumber2){ | |
bigger = 1; | |
}else{ | |
bigger = 0; | |
} | |
while (digitalRead(pin_in1) == HIGH){ | |
if (bigger == 1 || digitalRead(pin_in2) == HIGH){ | |
turn_on(pin_out1); | |
turn_on(pin_out2); | |
}else if (bigger == 0){ | |
turn_off(pin_out2); | |
turn_off(pin_out1); | |
} | |
} | |
turn_off(pin_out1); | |
turn_off(pin_out2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment