Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DataPool MD_PID mbed
Diff: 2017_3_h/MD/MD.cpp
- Revision:
- 0:b8fa7a019f5d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2017_3_h/MD/MD.cpp Fri Aug 25 05:10:49 2017 +0000 @@ -0,0 +1,20 @@ +#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; + } +} \ No newline at end of file