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: src/motor.cpp
- Revision:
- 25:8a34b8d6cc6e
- Parent:
- 23:112c0be5a7f3
- Child:
- 28:21773a6fb6df
--- a/src/motor.cpp Tue Nov 19 19:12:42 2013 +0000
+++ b/src/motor.cpp Tue Nov 19 20:42:01 2013 +0000
@@ -1,7 +1,8 @@
#include "mbed.h"
#include "include/motor.hpp"
-Motor::Motor(PinName aPin, PinName fPin, PinName bPin, PinName pwmPin, PinName encA, PinName encB):aIn(aPin),Forward(fPin),Backward(bPin),pwmOut(pwmPin),encoder(encA, encB, NC, 1200, QEI::X4_ENCODING){ //15,17,18,21,25,26 and 16,19,20,22,23,24
+Motor::Motor(PinName aPin, PinName fPin, PinName bPin, PinName pwmPin, QEI enc):aIn(aPin),Forward(fPin),Backward(bPin),pwmOut(pwmPin),encoder(enc){
+//15,17,18,21,qei25,26 and 16,19,20,22,qei23,24
freq =.001;
voltage = 12.0;
@@ -20,6 +21,8 @@
void Motor::stop(){
t.detach();
pwmOut.write(0);
+ dAngle=0;
+ dAngularVelocity=0;
}
void Motor::zero(){
