2021-01-29 06:31:58 -05:00
|
|
|
//
|
2022-07-27 06:53:36 -04:00
|
|
|
// FILE: HeartBeat_array.ino
|
2021-01-29 06:31:58 -05:00
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// PURPOSE: demo
|
|
|
|
|
|
|
|
|
|
|
|
#include "HeartBeat.h"
|
|
|
|
|
|
|
|
|
|
|
|
HeartBeat HB[3];
|
|
|
|
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
2022-07-27 06:53:36 -04:00
|
|
|
Serial.println();
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.println(__FILE__);
|
2022-07-27 06:53:36 -04:00
|
|
|
Serial.print("HEARTBEAT_LIB_VERSION: ");
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.println(HEARTBEAT_LIB_VERSION);
|
|
|
|
|
|
|
|
HB[0].begin(11, 1);
|
|
|
|
HB[1].begin(12, 3);
|
|
|
|
HB[2].begin(13, 5);
|
2021-11-02 12:26:51 -04:00
|
|
|
HB[0].setDutyCycle(20);
|
|
|
|
HB[1].setDutyCycle(30);
|
|
|
|
HB[2].setDutyCycle(40);
|
2021-01-29 06:31:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
// update all heartbeats
|
|
|
|
for (int i = 0; i < 3; i++) HB[i].beat();
|
|
|
|
|
|
|
|
// do other stuff here
|
|
|
|
}
|
|
|
|
|
2021-05-28 07:30:27 -04:00
|
|
|
|
|
|
|
// -- END OF FILE --
|