// Ex 8 - PWM Generator
#include <smart_duty_cycling.h>
smart_duty_cycling cycle;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
cycle.setFrequencyDutyCycle(1,0.5); // Frequency (in Hz)(float) and Duty Cycle (0.0-1.0)(float) respectively
}
void loop() {
// put your main code here, to run repeatedly:
if(cycle.switchMode())
{
if(cycle.wake)
{
//Perform operation in Wake / Active / ON time
digitalWrite(13,HIGH);
}
else
{
//Perform operation in Sleep / Inactive / OFF time
digitalWrite(13,LOW);
}
}
}