2021-01-29 12:31:58 +01:00
|
|
|
//
|
2022-07-27 12:53:36 +02:00
|
|
|
// FILE: HeartBeat_dutyCycle.ino
|
2021-01-29 12:31:58 +01:00
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// PURPOSE: demo
|
|
|
|
|
|
|
|
|
|
|
|
#include "HeartBeat.h"
|
|
|
|
|
|
|
|
|
|
|
|
HeartBeat HB;
|
|
|
|
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
2022-07-27 12:53:36 +02:00
|
|
|
Serial.println();
|
2021-01-29 12:31:58 +01:00
|
|
|
Serial.println(__FILE__);
|
2022-07-27 12:53:36 +02:00
|
|
|
Serial.print("HEARTBEAT_LIB_VERSION: ");
|
2021-01-29 12:31:58 +01:00
|
|
|
Serial.println(HEARTBEAT_LIB_VERSION);
|
|
|
|
|
2021-11-02 17:26:51 +01:00
|
|
|
HB.begin(13, 3); // PIN 13 with frequency 3
|
|
|
|
HB.setDutyCycle(17.53);
|
|
|
|
|
|
|
|
Serial.print("FR: ");
|
|
|
|
Serial.println(HB.getFrequency());
|
|
|
|
Serial.print("DC: ");
|
|
|
|
Serial.println(HB.getDutyCycle());
|
2021-01-29 12:31:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
HB.beat();
|
|
|
|
|
|
|
|
// do other stuff here
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -- END OF FILE --
|