Skip to content

Instantly share code, notes, and snippets.

@mosser
Created June 23, 2015 13:33
Show Gist options
  • Save mosser/10af5cafab16a173129f to your computer and use it in GitHub Desktop.
Save mosser/10af5cafab16a173129f to your computer and use it in GitHub Desktop.
ArduinoML target generation example
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