yajuan yue / Mbed 2 deprecated ele350

Dependencies:   mbed

Fork of ele350 by JIAWEI ZHANG

soft_pwm.h

Committer:
GGHHHH
Date:
2015-11-05
Revision:
4:badd73a8d806

File content as of revision 4:badd73a8d806:

#ifndef _SOFT_PWM_
#define _SOFT_PWM_

#include "mbed.h"

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