added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/motor/motor.cpp
- Revision:
- 55:bca9c9e92da6
- Parent:
- 45:088885f4a13d
- Child:
- 56:a550127695b2
diff -r cce34958f952 -r bca9c9e92da6 quadCommand/motor/motor.cpp --- a/quadCommand/motor/motor.cpp Tue Jun 11 02:36:12 2013 +0000 +++ b/quadCommand/motor/motor.cpp Thu Jun 13 01:11:03 2013 +0000 @@ -30,16 +30,16 @@ void motor::setSpeed( float value ) { // Is the value to small? - if( value < 0 ) // Yup, just set to 0. + if( value - trim < 0 ) // Yup, just set to 0. currentSpeed = 0; // Is the value to large? - else if( value > 100 ) // Yup, just set to 100. + else if( value + trim > 100 ) // Yup, just set to 100. currentSpeed = 100; // Value must be in the correct range. else - currentSpeed = value; // Set the new value. + currentSpeed = value + trim; // Set the new value. // Calculate the value based on pulseMin, pulseMax and currentSpeed. pulse = ((pulseMax - pulseMin ) / 100 * currentSpeed ) + pulseMin;