GY-63_MS5611/libraries/CountDown/examples/countdown_demo2/countdown_demo2.ino

64 lines
1009 B
Arduino
Raw Normal View History

//
// FILE: countdown_demo2.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// DATE: 2015-10-28
// URL: http://forum.arduino.cc/index.php?topic=356253
//
// Released to the public domain
//
#include "CountDown.h"
CountDown CD[5];
2020-11-27 05:10:47 -05:00
uint8_t lines = 0;
void setup()
{
2020-11-27 05:10:47 -05:00
Serial.begin(115200);
Serial.println(__FILE__);
Serial.print("COUNTDOWN_LIB_VERSION: ");
Serial.println(COUNTDOWN_LIB_VERSION);
for (int i = 0; i < 5; i++)
{
CD[i].start(10000UL * i);
}
delay(1234);
CD[3].stop();
}
void loop()
{
2020-11-27 05:10:47 -05:00
if (lines == 10)
{
lines = 0;
Serial.println();
2020-11-27 05:10:47 -05:00
}
lines++;
2020-11-27 05:10:47 -05:00
for (int i = 0; i < 5; i++)
{
Serial.print("\t");
Serial.print(CD[i].remaining());
}
for (int i = 0; i < 5; i++)
{
Serial.print("\t");
Serial.print(CD[i].isRunning());
}
Serial.println();
2020-11-27 05:10:47 -05:00
if (CD[1].isRunning() == false && CD[3].isRunning() == false)
{
uint32_t x = CD[3].remaining();
CD[3].start(x);
}
delay(250);
}
2020-11-27 05:10:47 -05:00
// -- END OF FILE --