Created
June 23, 2015 13:33
-
-
Save mosser/10af5cafab16a173129f to your computer and use it in GitHub Desktop.
ArduinoML target generation example
This file contains hidden or 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() { | |
pinMode(9,INPUT); | |
pinMode(12,OUTPUT); | |
} | |
void loop() { state_off(); } | |
void state_on() { | |
digitalWrite(12, HIGH); | |
if (digitalRead(9) == LOW) { state_off(); } else { state_on(); } | |
} | |
void state_off() { | |
digitalWrite(12, LOW); | |
if (digitalRead(9) == HIGH) { state_on(); } else { state_off(); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment