Created
March 20, 2016 14:11
-
-
Save AndiSHFR/578ecbd28b7b1d8eab85 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
/** | |
* PulseHeartbeat | |
* | |
* Blink the onboard LED to signal "Yepp, we are still runnning". | |
* The onbaord LED is on pin 13 and so pin 13 will be set to OUTPUT. | |
* | |
* Call this at the beginning of your loop() function. | |
* Caution: Will only work if millis() if functional and no one else | |
* did hook up timer0. | |
*/ | |
void PulseHeartbeat(void) { | |
static unsigned long lastMillis = 0; | |
if(0 == lastMillis) { | |
pinMode(13, OUTPUT); | |
} | |
lastMillis = millis(); | |
digitalWrite(13, ((lastMillis / 1000) % 2 ? HIGH : LOW)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment