23 virtual bool enabled() = 0;
25 virtual void enabled(
bool value) = 0;
30 return _dutyCycle * 1000000.0 / _frequency;
38 _dutyCycle = value * _frequency / 1000000.0;
43 virtual void updateDutyCycle() = 0;
virtual void dutyCycle(double value)
Sets the duty cycle.
Definition: Pwm.h:15
virtual double pulseWidth()
Gets the pulse width.
Definition: Pwm.h:28
virtual void pulseWidth(double value)
Sets the pulse width.
Definition: Pwm.h:34
virtual double dutyCycle()
Gets the duty cycle.
Definition: Pwm.h:12
virtual ~Pwm()
Definition: Pwm.h:9
static bool closeTo(double a, double b, double error=0.001)
#define TREEHOPPER_API
Definition: Treehopper.h:17