Created
August 8, 2017 06:24
-
-
Save schlerp/c9948bd6ca12a1983cbea1709c4d8c05 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 setup () { | |
// do what ever to get it all set up | |
// only ran once at poweron | |
} | |
void main () { | |
if (sensorpin is low && analogread value less than x) { | |
set pin high | |
} | |
if (sensorpin high && analogread value above y) { | |
set pin back down to low | |
} | |
//when it gets to here it goes back to the start of the main loop. | |
// so it might try those statements 1000 times before the sensorvalue | |
// gets high enough for the second if statement to switch the pin back down | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment