GY-63_MS5611/libraries/HT16K33/examples/demo_displayTime/demo_displayTime.ino

47 lines
770 B
Arduino
Raw Normal View History

2020-11-27 05:16:22 -05:00
//
// FILE: demo_displayTime.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// URL: http://www.adafruit.com/products/1002
// URL: https://github.com/RobTillaart/HT16K33
// sketch will work correctly up to 99:99
#include "HT16K33.h"
HT16K33 seg(0x70);
2021-05-26 09:01:19 -04:00
2020-11-27 05:16:22 -05:00
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
seg.begin();
Wire.setClock(100000);
seg.displayOn();
seg.setDigits(4);
}
2021-05-26 09:01:19 -04:00
2020-11-27 05:16:22 -05:00
void loop()
{
static uint32_t last = 0;
uint32_t now = millis();
if (now != last)
{
last = now;
uint32_t s = now / 1000;
uint32_t t = (now - s * 1000) / 10;
s = s % 100;
2021-12-19 09:24:23 -05:00
// seg.displayTime(s, t);
2021-05-26 09:01:19 -04:00
seg.displayTime(s, t, true, false); // do not display leading zero.
2020-11-27 05:16:22 -05:00
seg.displayColon(1);
}
}
2021-05-26 09:01:19 -04:00
2020-11-27 05:16:22 -05:00
// -- END OF FILE --
2021-12-19 09:24:23 -05:00