11.07.2015 Views

arduino state machine code examples - Making Things Interactive

arduino state machine code examples - Making Things Interactive

arduino state machine code examples - Making Things Interactive

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}//// if we were using a momentary switch to start things, we'd have// to push the momentary switch again to start the sensor. If// we're using an on/off switch, the <strong>state</strong> <strong>machine</strong> will start up// again if the switch is still in the on position.currentState = sOff;nextState = sRed;}void PulseLed(int pin) {for (int i=0; i=0; i--) {analogWrite(pin, i);delay(1);}}void BlinkStatusLed(){digitalWrite(statusLed,HIGH);delay(100);digitalWrite(statusLed,LOW);;delay(100);}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!