Skip to content

Instantly share code, notes, and snippets.

@mcgodfrey
Created March 26, 2016 02:12
Show Gist options
  • Save mcgodfrey/9f7d871b1ce7590b98a6 to your computer and use it in GitHub Desktop.
Save mcgodfrey/9f7d871b1ce7590b98a6 to your computer and use it in GitHub Desktop.
Code snippet for timers in homebrew temperature logger
void loop() {
//poll the timers
//if any of these have expired then their callback will automatically run.
conversionTimer.run();
measTimer.run();
display_timeout.run();
//...
//reset the display timeout timer if a button was pressed
if(button_up.pushed() || button_down.pushed() || button_select.pushed()){
display_timeout.restart();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment