ALPHA_A

Dependencies:   DataPool MD_PID mbed

2017_4/MD/MD.cpp

Committer:
hirotayamato
Date:
2017-09-07
Revision:
3:42fdfd41f96a
Parent:
0:e77e7d7bbae0

File content as of revision 3:42fdfd41f96a:

#include"mbed.h"
#include"MD.h"
MD::MD(PinName pwm,PinName dere):Pwm(pwm),Dere(dere)
{
    Pwm.period(0.0001);
}

void MD::rotate(double duty)
{
    if(duty > 0)
    {
        Dere = 0;
        Pwm = duty;
    }
    else
    {
        Dere = 1;
        Pwm = -duty;
    }
}