2017-07-16 05:46:43 -04:00
|
|
|
//
|
|
|
|
// FILE: demo_DHMS.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// VERSION: 0.1.0
|
|
|
|
// PURPOSE: demo
|
|
|
|
// DATE: 2017-07-16
|
|
|
|
// URL: http://forum.arduino.cc/index.php?topic=356253
|
2021-01-29 06:31:58 -05:00
|
|
|
// https://github.com/RobTillaart/CountDown
|
2017-07-16 05:46:43 -04:00
|
|
|
//
|
|
|
|
|
2021-10-19 15:40:11 -04:00
|
|
|
|
2017-07-16 05:46:43 -04:00
|
|
|
#include "CountDown.h"
|
|
|
|
|
|
|
|
CountDown CD;
|
|
|
|
|
2021-10-19 15:40:11 -04:00
|
|
|
|
2017-07-16 05:46:43 -04:00
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.println(__FILE__);
|
|
|
|
Serial.print("COUNTDOWN_LIB_VERSION: ");
|
|
|
|
Serial.println(COUNTDOWN_LIB_VERSION);
|
|
|
|
|
|
|
|
// countdown 1 minute
|
|
|
|
CD.start(0, 0, 1, 0);
|
|
|
|
}
|
|
|
|
|
2021-10-19 15:40:11 -04:00
|
|
|
|
2017-07-16 05:46:43 -04:00
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
static uint32_t last_remaining = 0;
|
2020-11-27 05:10:47 -05:00
|
|
|
if (last_remaining != CD.remaining() || CD.remaining() == 0 )
|
2017-07-16 05:46:43 -04:00
|
|
|
{
|
|
|
|
Serial.println();
|
|
|
|
last_remaining = CD.remaining();
|
|
|
|
}
|
|
|
|
Serial.print('\t');
|
|
|
|
Serial.print(CD.remaining());
|
|
|
|
delay(250);
|
2021-10-19 15:40:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -- END OF FILE --
|
|
|
|
|