elec350

Dependencies:   mbed

Fork of elec350 by Bob Merrison-Hort

soft_pwm.h

Committer:
rmerrisonhort
Date:
2015-10-21
Revision:
11:4685f33a2468
Parent:
10:021f19a9861f
Child:
12:ae626e46b996

File content as of revision 11:4685f33a2468:

#ifndef _SOFT_PWM_
#define _SOFT_PWM_

#include "mbed.h"

class SoftPwm
{
    private:
        float period;
        float dutyCycle;
        Timer timer;
    public:
        SoftPwm(float initialPeriod, float initialDutycycle);
        
        void setPeriod(float newPeriod);
        void setDutyCycle(float newDutyCycle);
        
        float getDutyCycle();
        float getPeriod();
        
        bool isOn();        
};

#endif