Skip to content

Instantly share code, notes, and snippets.

@rafacouto
Created April 8, 2020 10:24
Show Gist options
  • Save rafacouto/5c699752dcee4d90fa4c383bdc9f087f to your computer and use it in GitHub Desktop.
Save rafacouto/5c699752dcee4d90fa4c383bdc9f087f to your computer and use it in GitHub Desktop.
#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