GAMMA_A

Dependencies:   DataPool MD_PID mbed

Committer:
hirotayamato
Date:
Tue Aug 22 04:55:34 2017 +0000
Revision:
0:6ed41770a6b7
Child:
2:158fea945e51
GAMMA_A;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hirotayamato 0:6ed41770a6b7 1 #include"mbed.h"
hirotayamato 0:6ed41770a6b7 2 #include"MD.h"
hirotayamato 0:6ed41770a6b7 3 MD::MD(PinName pwm,PinName dere):Pwm(pwm),Dere(dere)
hirotayamato 0:6ed41770a6b7 4 {
hirotayamato 0:6ed41770a6b7 5 Pwm.period(0.0001);
hirotayamato 0:6ed41770a6b7 6 }
hirotayamato 0:6ed41770a6b7 7
hirotayamato 0:6ed41770a6b7 8 void MD::rotate(double duty)
hirotayamato 0:6ed41770a6b7 9 {
hirotayamato 0:6ed41770a6b7 10 if(duty > 0)
hirotayamato 0:6ed41770a6b7 11 {
hirotayamato 0:6ed41770a6b7 12 Dere = 0;
hirotayamato 0:6ed41770a6b7 13 Pwm = duty;
hirotayamato 0:6ed41770a6b7 14 }
hirotayamato 0:6ed41770a6b7 15 else
hirotayamato 0:6ed41770a6b7 16 {
hirotayamato 0:6ed41770a6b7 17 Dere = 1;
hirotayamato 0:6ed41770a6b7 18 Pwm = -duty;
hirotayamato 0:6ed41770a6b7 19 }
hirotayamato 0:6ed41770a6b7 20 }