Eurobot2012_Primary

Dependencies:   mbed Eurobot_2012_Primary

Committer:
narshu
Date:
Thu May 03 14:20:04 2012 +0000
Revision:
22:7ba09c0af0d0
Parent:
2:cffa347bb943
Child:
23:1901cb6d0d95
added 90sec timer and tigger

Who changed what in which revision?

UserRevisionLine numberNew contents of line
narshu 2:cffa347bb943 1 /**********************************************************
narshu 2:cffa347bb943 2 * Motors.cpp
narshu 2:cffa347bb943 3 *
narshu 2:cffa347bb943 4 * This is a motor control library for the UK1122 L298N based motor controller.
narshu 2:cffa347bb943 5 * Includes PID controller to control motors speeds
narshu 2:cffa347bb943 6 *
narshu 2:cffa347bb943 7 * Author: Crispian Poon
narshu 2:cffa347bb943 8 * Email: pooncg@gmail.com
narshu 2:cffa347bb943 9 * Purpose: Eurobot 2012 - ICRS Imperial College London
narshu 2:cffa347bb943 10 * Date: 4th April 2012
narshu 2:cffa347bb943 11 * Version: v0.12
narshu 2:cffa347bb943 12 **********************************************************/
narshu 2:cffa347bb943 13
narshu 2:cffa347bb943 14 #include "mbed.h"
narshu 2:cffa347bb943 15 #include "motors.h"
narshu 2:cffa347bb943 16 #include "QEI.h" //quadrature encoder library
narshu 2:cffa347bb943 17 #include "globals.h"
narshu 2:cffa347bb943 18 #include "TSH.h"
narshu 2:cffa347bb943 19
narshu 2:cffa347bb943 20 //*************************************************************************************
narshu 2:cffa347bb943 21 // Constructor
narshu 2:cffa347bb943 22 //*************************************************************************************
narshu 2:cffa347bb943 23 Motors::Motors():
narshu 2:cffa347bb943 24 Encoder1 (p30, p29, NC, 1856 ,QEI::X4_ENCODING), //connects to motor1 quadracture encoders
narshu 2:cffa347bb943 25 Encoder2 (p27, p28, NC, 1856 ,QEI::X4_ENCODING), //connects to motor2 quadracture encoders
narshu 2:cffa347bb943 26 Motor1A(p17), Motor1B(p18), Motor2A(p19), Motor2B(p13), //connects to direction pins
narshu 2:cffa347bb943 27 Motor1Enable(p25), Motor2Enable(p26), //Connects to control board enable pins to control motors speeds. PWM pins. Remember enable must be set before the direction pins changed!!
narshu 22:7ba09c0af0d0 28 //PIDControllerMotor1(2.25, 0.3, 0.00001, 0.010), PIDControllerMotor2(2.25, 0.3, 0.00001, 0.010)
narshu 22:7ba09c0af0d0 29 PIDControllerMotor1(3.5, 0.5, 0.0, 0.010), PIDControllerMotor2(3.5, 0.5, 0.0, 0.010){
narshu 2:cffa347bb943 30
narshu 2:cffa347bb943 31 //Initialise PID controllers
narshu 2:cffa347bb943 32 PIDControllerMotor1.setMode(MANUAL_MODE);
narshu 2:cffa347bb943 33 PIDControllerMotor2.setMode(MANUAL_MODE);
narshu 2:cffa347bb943 34 PIDControllerMotor1.setBias(-16);
narshu 2:cffa347bb943 35 PIDControllerMotor2.setBias(-16);
narshu 2:cffa347bb943 36 PIDControllerMotor1.setOutputLimits(-127, 127);
narshu 2:cffa347bb943 37 PIDControllerMotor2.setOutputLimits(-127, 127);
narshu 2:cffa347bb943 38 PIDControllerMotor1.setInputLimits(-102, 102);
narshu 2:cffa347bb943 39 PIDControllerMotor2.setInputLimits(-102, 102);
narshu 2:cffa347bb943 40 _lastEncoder1 = 0;
narshu 2:cffa347bb943 41 _lastEncoder2 = 0;
narshu 2:cffa347bb943 42
narshu 2:cffa347bb943 43 //speed regulator task using PID. Run every 10ms.
narshu 2:cffa347bb943 44 _ticker.attach(this, &Motors::speedRegulatorTask, 0.01);
narshu 2:cffa347bb943 45
narshu 2:cffa347bb943 46 };
narshu 2:cffa347bb943 47
narshu 2:cffa347bb943 48
narshu 2:cffa347bb943 49 //*************************************************************************************
narshu 2:cffa347bb943 50 // Public functions
narshu 2:cffa347bb943 51 //*************************************************************************************
narshu 2:cffa347bb943 52
narshu 2:cffa347bb943 53 //*********************************************
narshu 2:cffa347bb943 54 //
narshu 2:cffa347bb943 55 // @Description speed regulator task using PID. Run every 10ms.
narshu 2:cffa347bb943 56 //
narshu 2:cffa347bb943 57 //*********************************************
narshu 2:cffa347bb943 58 void Motors::speedRegulatorTask() {
narshu 2:cffa347bb943 59
narshu 2:cffa347bb943 60 int latestMotor1Speed = 0;
narshu 2:cffa347bb943 61 int latestMotor2Speed = 0;
narshu 2:cffa347bb943 62 int computedSpeed1 = 0;
narshu 2:cffa347bb943 63 int computedSpeed2 = 0;
narshu 2:cffa347bb943 64
narshu 2:cffa347bb943 65 //acceleration control
narshu 2:cffa347bb943 66 if (accelerationRegister == 1) {
narshu 2:cffa347bb943 67 if (_accelerationSpeed1 != 0) {
narshu 2:cffa347bb943 68
narshu 2:cffa347bb943 69 if (abs(_motorSpeed1) < abs(_accelerationSpeed1)) {
narshu 2:cffa347bb943 70 _motorSpeed1 += getSignOfInt(_accelerationSpeed1);
narshu 2:cffa347bb943 71 } else if (abs(_motorSpeed1) > abs(_accelerationSpeed1)) {
narshu 2:cffa347bb943 72 _motorSpeed1 = _accelerationSpeed1;
narshu 2:cffa347bb943 73 }
narshu 2:cffa347bb943 74 }
narshu 2:cffa347bb943 75 if (_accelerationSpeed2 != 0) {
narshu 2:cffa347bb943 76 if (abs(_motorSpeed2) < abs(_accelerationSpeed2)) {
narshu 2:cffa347bb943 77 _motorSpeed2 += getSignOfInt(_accelerationSpeed2);
narshu 2:cffa347bb943 78 } else if (abs(_motorSpeed2) > abs(_accelerationSpeed2)) {
narshu 2:cffa347bb943 79 _motorSpeed2 = _accelerationSpeed2;
narshu 2:cffa347bb943 80 }
narshu 2:cffa347bb943 81 }
narshu 2:cffa347bb943 82 }
narshu 2:cffa347bb943 83
narshu 2:cffa347bb943 84
narshu 2:cffa347bb943 85 //MOTOR 1 PID
narshu 2:cffa347bb943 86 latestMotor1Speed = getEncoder1() - _lastEncoder1; //motor1 encoder change
narshu 2:cffa347bb943 87 //PID setpoints for 50ms interval.
narshu 2:cffa347bb943 88 if (_motorSpeed1 == 0) {
narshu 2:cffa347bb943 89 PIDControllerMotor1.setSetPoint(0);
narshu 2:cffa347bb943 90 } else {
narshu 2:cffa347bb943 91 PIDControllerMotor1.setSetPoint((int)(102*((float)_motorSpeed1/127)));
narshu 2:cffa347bb943 92 }
narshu 2:cffa347bb943 93 //Process value
narshu 2:cffa347bb943 94 PIDControllerMotor1.setProcessValue(latestMotor1Speed);
narshu 2:cffa347bb943 95 //PID Compute
narshu 2:cffa347bb943 96 computedSpeed1 = (int)PIDControllerMotor1.compute();
narshu 2:cffa347bb943 97
narshu 2:cffa347bb943 98
narshu 2:cffa347bb943 99
narshu 2:cffa347bb943 100 //MOTOR 2 PID
narshu 2:cffa347bb943 101 latestMotor2Speed = getEncoder2() - _lastEncoder2; //motor2 encoder change
narshu 2:cffa347bb943 102 //PID setpoints for 50ms interval.
narshu 2:cffa347bb943 103 if (_motorSpeed2 == 0) {
narshu 2:cffa347bb943 104 PIDControllerMotor2.setSetPoint(0);
narshu 2:cffa347bb943 105 } else {
narshu 2:cffa347bb943 106 PIDControllerMotor2.setSetPoint((int)(102*((float)_motorSpeed2/127)));
narshu 2:cffa347bb943 107 }
narshu 2:cffa347bb943 108 //Process value
narshu 2:cffa347bb943 109 PIDControllerMotor2.setProcessValue(latestMotor2Speed);
narshu 2:cffa347bb943 110 //PID Compute
narshu 2:cffa347bb943 111 computedSpeed2 = (int)PIDControllerMotor2.compute();
narshu 2:cffa347bb943 112
narshu 2:cffa347bb943 113
narshu 2:cffa347bb943 114
narshu 2:cffa347bb943 115 //debug variables
narshu 2:cffa347bb943 116 _debug1 = latestMotor1Speed;
narshu 2:cffa347bb943 117 _debug2 = computedSpeed1;
narshu 2:cffa347bb943 118
narshu 2:cffa347bb943 119
narshu 2:cffa347bb943 120
narshu 2:cffa347bb943 121 //Set motors speed
narshu 2:cffa347bb943 122 _setSpeed(computedSpeed1, computedSpeed2);
narshu 2:cffa347bb943 123
narshu 2:cffa347bb943 124 }
narshu 2:cffa347bb943 125
narshu 2:cffa347bb943 126 //*********************************************
narshu 2:cffa347bb943 127 //
narshu 2:cffa347bb943 128 // @Description External set speed function for both motors
narshu 2:cffa347bb943 129 // @Parameter [speed] ranges from -127 (revse motor) to 127 (forward motor)
narshu 2:cffa347bb943 130 //
narshu 2:cffa347bb943 131 //*********************************************
narshu 2:cffa347bb943 132 void Motors::setSpeed(int speed) {
narshu 2:cffa347bb943 133 setSpeed(speed, speed);
narshu 2:cffa347bb943 134 }
narshu 2:cffa347bb943 135
narshu 2:cffa347bb943 136 //*********************************************
narshu 2:cffa347bb943 137 //
narshu 2:cffa347bb943 138 // @Description External set speed function. Relies on the speedRegulatorTask to change speed.
narshu 2:cffa347bb943 139 // @Parameters [speed1] min -127 (reverse motor), max 127 (forward motor)
narshu 2:cffa347bb943 140 // @Parameters [speed2] min -127 (reverse motor), max 127 (forward motor)
narshu 2:cffa347bb943 141 //
narshu 2:cffa347bb943 142 //*********************************************
narshu 2:cffa347bb943 143 void Motors::setSpeed(int speed1, int speed2) {
narshu 2:cffa347bb943 144 //set global motor values
narshu 2:cffa347bb943 145 _motorSpeed1 = speed1;
narshu 2:cffa347bb943 146 _motorSpeed2 = speed2;
narshu 2:cffa347bb943 147 _lastEncoder1 = getEncoder1();
narshu 2:cffa347bb943 148 _lastEncoder2 = getEncoder2();
narshu 2:cffa347bb943 149
narshu 2:cffa347bb943 150 //acceleration control
narshu 2:cffa347bb943 151 if (accelerationRegister == 1) {
narshu 2:cffa347bb943 152 //target accelerated speed
narshu 2:cffa347bb943 153 _accelerationSpeed1 = speed1;
narshu 2:cffa347bb943 154 _accelerationSpeed2 = speed2;
narshu 2:cffa347bb943 155
narshu 2:cffa347bb943 156 //current speed
narshu 2:cffa347bb943 157 _motorSpeed1 = 0;
narshu 2:cffa347bb943 158 _motorSpeed2 = 0;
narshu 2:cffa347bb943 159 }
narshu 2:cffa347bb943 160 }
narshu 2:cffa347bb943 161
narshu 2:cffa347bb943 162 //*********************************************
narshu 2:cffa347bb943 163 //
narshu 2:cffa347bb943 164 // @Description stops motors
narshu 2:cffa347bb943 165 //
narshu 2:cffa347bb943 166 //*********************************************
narshu 2:cffa347bb943 167 void Motors::stop()
narshu 2:cffa347bb943 168 {
narshu 2:cffa347bb943 169 setSpeed(0);
narshu 2:cffa347bb943 170 }
narshu 2:cffa347bb943 171
narshu 2:cffa347bb943 172 //*********************************************
narshu 2:cffa347bb943 173 //
narshu 2:cffa347bb943 174 // @Description resets motor1 and motor encoders
narshu 2:cffa347bb943 175 //
narshu 2:cffa347bb943 176 //*********************************************
narshu 2:cffa347bb943 177 void Motors::resetEncoders() {
narshu 2:cffa347bb943 178 Encoder1.reset();
narshu 2:cffa347bb943 179 Encoder2.reset();
narshu 2:cffa347bb943 180 }
narshu 2:cffa347bb943 181
narshu 2:cffa347bb943 182 //*********************************************
narshu 2:cffa347bb943 183 //
narshu 2:cffa347bb943 184 // @Description gets motor1 encoder
narshu 2:cffa347bb943 185 // @returns motor1 encoder counts
narshu 2:cffa347bb943 186 //
narshu 2:cffa347bb943 187 //*********************************************
narshu 2:cffa347bb943 188 int Motors::getEncoder1() {
narshu 2:cffa347bb943 189 return Encoder1.getPulses();
narshu 2:cffa347bb943 190 }
narshu 2:cffa347bb943 191
narshu 2:cffa347bb943 192 //*********************************************
narshu 2:cffa347bb943 193 //
narshu 2:cffa347bb943 194 // @Description gets motor2 encoder
narshu 2:cffa347bb943 195 // @returns motor2 encoder counts
narshu 2:cffa347bb943 196 //
narshu 2:cffa347bb943 197 //*********************************************
narshu 2:cffa347bb943 198 int Motors::getEncoder2() {
narshu 2:cffa347bb943 199 return Encoder2.getPulses();
narshu 2:cffa347bb943 200 }
narshu 2:cffa347bb943 201
narshu 2:cffa347bb943 202 //*********************************************
narshu 2:cffa347bb943 203 //
narshu 2:cffa347bb943 204 // @Description converts encoder counts to distance in mm
narshu 2:cffa347bb943 205 // @Parameters [encoder] (int) encoder counts
narshu 2:cffa347bb943 206 // @returns distance in mm
narshu 2:cffa347bb943 207 //
narshu 2:cffa347bb943 208 //*********************************************
narshu 2:cffa347bb943 209 int Motors::encoderToDistance(int encoder) {
narshu 2:cffa347bb943 210 return int((float(encoder) / float(encoderRevCount)) * wheelmm);
narshu 2:cffa347bb943 211 }
narshu 2:cffa347bb943 212
narshu 2:cffa347bb943 213 //*********************************************
narshu 2:cffa347bb943 214 //
narshu 2:cffa347bb943 215 // @Description converts distance in mm to encoder counts
narshu 2:cffa347bb943 216 // @Parameters [distance] (int) distance in mm
narshu 2:cffa347bb943 217 // @returns encoder counts
narshu 2:cffa347bb943 218 //
narshu 2:cffa347bb943 219 //*********************************************
narshu 2:cffa347bb943 220 int Motors::distanceToEncoder(int distance) {
narshu 2:cffa347bb943 221 return int((float(distance) / float(wheelmm)) * encoderRevCount);
narshu 2:cffa347bb943 222 }
narshu 2:cffa347bb943 223
narshu 2:cffa347bb943 224 //*********************************************
narshu 2:cffa347bb943 225 //
narshu 2:cffa347bb943 226 // @Description number sign indicator. determines if number is positive or negative.
narshu 2:cffa347bb943 227 // @Parameters [direction] (int) a number
narshu 2:cffa347bb943 228 // @returns -1 if negative, 1 if positive
narshu 2:cffa347bb943 229 //
narshu 2:cffa347bb943 230 //*********************************************
narshu 2:cffa347bb943 231 int Motors::getSignOfInt(int direction) {
narshu 2:cffa347bb943 232
narshu 2:cffa347bb943 233 if (direction > 0) {
narshu 2:cffa347bb943 234 return 1;
narshu 2:cffa347bb943 235 } else if (direction < 0) {
narshu 2:cffa347bb943 236 return -1;
narshu 2:cffa347bb943 237 }
narshu 2:cffa347bb943 238 return -1;
narshu 2:cffa347bb943 239 }
narshu 2:cffa347bb943 240
narshu 2:cffa347bb943 241 //*********************************************
narshu 2:cffa347bb943 242 //Start of quarantined functions
narshu 2:cffa347bb943 243
narshu 2:cffa347bb943 244 void Motors::move(int distance, int speed) {
narshu 2:cffa347bb943 245 //resetEncoders(); TODO use kalman as feedback instead!
narshu 2:cffa347bb943 246
narshu 2:cffa347bb943 247 int tempEndEncoder = 0;
narshu 2:cffa347bb943 248 int startEncoderCount = 0;
narshu 2:cffa347bb943 249
narshu 2:cffa347bb943 250 tempEndEncoder = distanceToEncoder(abs(distance));
narshu 2:cffa347bb943 251 startEncoderCount = getEncoder1();
narshu 2:cffa347bb943 252
narshu 2:cffa347bb943 253 setSpeed(getSignOfInt(distance) * speed);
narshu 2:cffa347bb943 254
narshu 2:cffa347bb943 255 while (abs(getEncoder1() - startEncoderCount) < tempEndEncoder) {
narshu 2:cffa347bb943 256 setSpeed(getSignOfInt(distance) * speed);
narshu 2:cffa347bb943 257 }
narshu 2:cffa347bb943 258
narshu 2:cffa347bb943 259 //resetEncoders();
narshu 2:cffa347bb943 260 setSpeed(0);
narshu 2:cffa347bb943 261 }
narshu 2:cffa347bb943 262
narshu 2:cffa347bb943 263 void Motors::turn(int angle, int speed) {
narshu 2:cffa347bb943 264 //resetEncoders(); TODO use kalman as feedback instead!
narshu 2:cffa347bb943 265 int tempDistance = int((float(angle) / 360) * float(robotCircumference));
narshu 2:cffa347bb943 266 int tempEndEncoder = 0;
narshu 2:cffa347bb943 267 int startEncoderCount = 0;
narshu 2:cffa347bb943 268
narshu 2:cffa347bb943 269 tempEndEncoder = distanceToEncoder(abs(tempDistance));
narshu 2:cffa347bb943 270 startEncoderCount = getEncoder1();
narshu 2:cffa347bb943 271 setSpeed(getSignOfInt(tempDistance) * speed, -getSignOfInt(tempDistance) * speed);
narshu 2:cffa347bb943 272
narshu 2:cffa347bb943 273 while (abs(getEncoder1() - startEncoderCount) < tempEndEncoder) {
narshu 2:cffa347bb943 274 setSpeed(getSignOfInt(tempDistance) * speed,-getSignOfInt(tempDistance) * speed);
narshu 2:cffa347bb943 275
narshu 2:cffa347bb943 276 }
narshu 2:cffa347bb943 277
narshu 2:cffa347bb943 278 //resetEncoders();
narshu 2:cffa347bb943 279 setSpeed(0);
narshu 2:cffa347bb943 280 }
narshu 2:cffa347bb943 281
narshu 2:cffa347bb943 282 //Start of quarantined functions
narshu 2:cffa347bb943 283 //*********************************************
narshu 2:cffa347bb943 284
narshu 2:cffa347bb943 285
narshu 2:cffa347bb943 286 //*************************************************************************************
narshu 2:cffa347bb943 287 // Private functions
narshu 2:cffa347bb943 288 //*************************************************************************************
narshu 2:cffa347bb943 289
narshu 2:cffa347bb943 290 //*********************************************
narshu 2:cffa347bb943 291 //
narshu 2:cffa347bb943 292 // @Description internal set speed function
narshu 2:cffa347bb943 293 // @Parameters speed1 min -127, max 127
narshu 2:cffa347bb943 294 // @Parameters speed2 min -127, max 127
narshu 2:cffa347bb943 295 //
narshu 2:cffa347bb943 296 //*********************************************
narshu 2:cffa347bb943 297 void Motors::_setSpeed(int speed1, int speed2) {
narshu 2:cffa347bb943 298
narshu 2:cffa347bb943 299 //set global encoder values
narshu 2:cffa347bb943 300 _lastEncoder1 = getEncoder1();
narshu 2:cffa347bb943 301 _lastEncoder2 = getEncoder2();
narshu 2:cffa347bb943 302
narshu 2:cffa347bb943 303 //Speed ranges from -127 to 127
narshu 2:cffa347bb943 304 if (speed1 > 0) {
narshu 2:cffa347bb943 305 //Motor1 forwards
narshu 2:cffa347bb943 306 Motor1Enable = (float)speed1/127;
narshu 2:cffa347bb943 307 Motor1A = 1;
narshu 2:cffa347bb943 308 Motor1B = 0;
narshu 2:cffa347bb943 309 //pwm the h bridge driver range 0 to 1 type float.
narshu 2:cffa347bb943 310
narshu 22:7ba09c0af0d0 311 } else if (speed1 <= 0) {
narshu 2:cffa347bb943 312 //Motor1 backwards
narshu 2:cffa347bb943 313 Motor1Enable = (float)abs(speed1)/127;
narshu 2:cffa347bb943 314 Motor1A = 0;
narshu 2:cffa347bb943 315 Motor1B = 1;
narshu 2:cffa347bb943 316
narshu 22:7ba09c0af0d0 317 }
narshu 22:7ba09c0af0d0 318 /*
narshu 22:7ba09c0af0d0 319 else if (speed1 ==0) {
narshu 2:cffa347bb943 320 _stop(1,0);
narshu 2:cffa347bb943 321 }
narshu 22:7ba09c0af0d0 322 */
narshu 2:cffa347bb943 323 if (speed2 > 0) {
narshu 2:cffa347bb943 324 //Motor2 forwards
narshu 2:cffa347bb943 325 Motor2Enable = (float)speed2/127;
narshu 2:cffa347bb943 326
narshu 2:cffa347bb943 327 Motor2A = 1;
narshu 2:cffa347bb943 328 Motor2B = 0;
narshu 2:cffa347bb943 329
narshu 22:7ba09c0af0d0 330 } else if (speed2 <= 0) {
narshu 2:cffa347bb943 331 //Motor2 backwards
narshu 2:cffa347bb943 332 Motor2Enable = (float)abs(speed2)/127;
narshu 2:cffa347bb943 333 Motor2A = 0;
narshu 2:cffa347bb943 334 Motor2B = 1;
narshu 22:7ba09c0af0d0 335 }
narshu 22:7ba09c0af0d0 336 /*
narshu 22:7ba09c0af0d0 337 else if (speed2 == 0) {
narshu 2:cffa347bb943 338 _stop(0,1);
narshu 2:cffa347bb943 339 }
narshu 22:7ba09c0af0d0 340 */
narshu 2:cffa347bb943 341
narshu 2:cffa347bb943 342 }
narshu 2:cffa347bb943 343
narshu 2:cffa347bb943 344
narshu 2:cffa347bb943 345 //*********************************************
narshu 2:cffa347bb943 346 //
narshu 2:cffa347bb943 347 // @Description stop command for both motors
narshu 2:cffa347bb943 348 //
narshu 2:cffa347bb943 349 //*********************************************
narshu 2:cffa347bb943 350 void Motors::_stop() {
narshu 2:cffa347bb943 351 _stop(1,1);
narshu 2:cffa347bb943 352 }
narshu 2:cffa347bb943 353
narshu 2:cffa347bb943 354 //*********************************************
narshu 2:cffa347bb943 355 //
narshu 2:cffa347bb943 356 // @Description stop command for individual motors
narshu 2:cffa347bb943 357 // @Parameter [motor1] stops motor1. =1 is stop. =0 do nothing
narshu 2:cffa347bb943 358 // @Parameter [motor2] stops motor2. =1 is stop. =0 do nothing
narshu 2:cffa347bb943 359 //
narshu 2:cffa347bb943 360 //*********************************************
narshu 2:cffa347bb943 361 void Motors::_stop(int motor1, int motor2) {
narshu 2:cffa347bb943 362 if (motor1 == 1) {
narshu 2:cffa347bb943 363 Motor1Enable = 1;
narshu 2:cffa347bb943 364 Motor1A = 0;
narshu 2:cffa347bb943 365 Motor1B = 0;
narshu 2:cffa347bb943 366 }
narshu 2:cffa347bb943 367
narshu 2:cffa347bb943 368 if (motor2 == 1) {
narshu 2:cffa347bb943 369 Motor2Enable = 1;
narshu 2:cffa347bb943 370 Motor2A = 0;
narshu 2:cffa347bb943 371 Motor2B = 0;
narshu 2:cffa347bb943 372 }
narshu 2:cffa347bb943 373
narshu 2:cffa347bb943 374 }
narshu 2:cffa347bb943 375
narshu 2:cffa347bb943 376 //*************************************************************************************
narshu 2:cffa347bb943 377 // Redundant functions
narshu 2:cffa347bb943 378 //*************************************************************************************
narshu 2:cffa347bb943 379
narshu 2:cffa347bb943 380 //Redudant
narshu 2:cffa347bb943 381 void Motors::setMode(int mode) {
narshu 2:cffa347bb943 382 }
narshu 2:cffa347bb943 383
narshu 2:cffa347bb943 384 //Redudant
narshu 2:cffa347bb943 385 void Motors::sendCommand(char command) {
narshu 2:cffa347bb943 386 }
narshu 2:cffa347bb943 387
narshu 2:cffa347bb943 388 //Redudant
narshu 2:cffa347bb943 389 void Motors::sendCommand(char command1, char command2 ) {
narshu 2:cffa347bb943 390 }