Created
April 8, 2020 10:24
-
-
Save rafacouto/5c699752dcee4d90fa4c383bdc9f087f to your computer and use it in GitHub Desktop.
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
#include <Arduino.h> | |
#include "LCDHAL.h" | |
#include "PINOUT.h" | |
#include <stdio.h> | |
LCDHAL ReespiratorLCD; | |
void setup() | |
{ | |
ReespiratorLCD.LCDPortInit(); | |
ReespiratorLCD.LCDInit(); | |
} | |
void update_time() | |
{ | |
static unsigned long next = 0; | |
auto now = millis(); | |
if (now >= next) | |
{ | |
unsigned seconds = now / 1000; | |
ReespiratorLCD.LCDGoto(0,2); | |
printf("%2u:%02u", seconds / 60, seconds % 60); | |
next = now + 1000; | |
} | |
} | |
void loop() | |
{ | |
update_time(); | |
ReespiratorLCD.Update(); | |
delay(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment