Omni_2017_a

Dependencies:   mbed

Fork of Omni_2017_z by 広田 勇斗

2017_3_a/MD/MD.cpp

Committer:
hirotayamato
Date:
2017-08-05
Revision:
2:82c337a18500
Parent:
2017_3/MD/MD.cpp@ 0:fd933ea5f19d

File content as of revision 2:82c337a18500:

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