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.
Diff: Motor.cpp
- Revision:
- 2:55726bc51f31
- Parent:
- 1:809c0963d521
- Child:
- 3:00a812f5ac69
--- a/Motor.cpp Sat Aug 17 04:52:35 2019 +0000
+++ b/Motor.cpp Fri Aug 30 03:06:27 2019 +0000
@@ -3,9 +3,11 @@
Motor::Motor(PinName _pwm, PinName _dire, int freq) : pwm(_pwm), dire(_dire)
{
- pwm_mode = SMB;
abs_max_output = 1.0;
pwm.period(1.0 / freq);
+ pwm.write(0);
+ dire = 0;
+ pwm_mode = SMB;
}