GAMMA_A

Dependencies:   DataPool MD_PID mbed

2017_3_b/MD/MD.cpp

Committer:
hirotayamato
Date:
2017-08-22
Revision:
0:6ed41770a6b7
Child:
2:158fea945e51

File content as of revision 0:6ed41770a6b7:

#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;
    }
}