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:
- 1:c75b234558af
- Parent:
- 0:f05e09f8f5d9
- Child:
- 2:11b3ef6b937d
diff -r f05e09f8f5d9 -r c75b234558af Motor.cpp
--- a/Motor.cpp Thu Sep 02 16:32:57 2010 +0000
+++ b/Motor.cpp Tue Sep 07 11:21:42 2010 +0000
@@ -45,3 +45,16 @@
_pwm.period(period);
}
+
+void Motor::brake(int highLow){
+
+ if(highLow == BRAKE_HIGH){
+ _fwd = 1;
+ _rev = 1;
+ }
+ else if(highLow == BRAKE_LOW){
+ _fwd = 0;
+ _rev = 0;
+ }
+
+}