added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/motor/motor.cpp
- Revision:
- 60:6906a96344a0
- Parent:
- 59:9dfd9169a5e7
--- a/quadCommand/motor/motor.cpp Wed Jul 03 04:45:03 2013 +0000 +++ b/quadCommand/motor/motor.cpp Sat Jul 20 02:28:04 2013 +0000 @@ -18,7 +18,7 @@ { pwmPin = new PwmOut( pin ); pwmPin->period( 0.020 ); // Set the period to 20ms. - setPulseMin( 0.001150 ); // Set default min pulse. + setPulseMin( 0.001000 ); // Set default min pulse. setPulseMax( 0.002 ); // Set default max pulse. setSpeed( 0 ); // Set motor to stopped. } @@ -35,15 +35,15 @@ currentSpeed = 0; // Is the value to large? - else if( value > 100 ) // Yup, just set to 100. - currentSpeed = 100; + else if( value > 500 ) // Yup, just set to 100. Changed to 500 to increase + currentSpeed = 500; // motor control resolution // Value must be in the correct range. else currentSpeed = value; // Set the new value. // Calculate the value based on pulseMin, pulseMax and currentSpeed. - pulse = ((pulseMax - pulseMin) / 100 * currentSpeed) + pulseMin; + pulse = ((pulseMax - pulseMin) / 500 * currentSpeed) + pulseMin; pwmPin->pulsewidth( pulse ); // Write the pulse to the pin. }