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.
Dependencies: mbed-dev-f303 FastPWM3
Dependents: GT_MOTOR_24NM_V03 GT_MOTOR_24NM_V03_PT1000CalTemp
Diff: PositionSensor/PositionSensor.cpp
- Revision:
- 12:c473a25f54f7
- Parent:
- 11:c83b18d41e54
- Child:
- 13:a3fa0a31b114
--- a/PositionSensor/PositionSensor.cpp Sun May 22 00:14:59 2016 +0000 +++ b/PositionSensor/PositionSensor.cpp Sun May 22 03:38:19 2016 +0000 @@ -140,9 +140,7 @@ } float PositionSensorEncoder::GetElecVelocity(){ - float rawPeriod = TIM2->CCR1; //Clock Ticks - float dir = (((TIM3->CR1)>>4)&1)*2-1; // +/- 1 - return dir*_ppairs*90000000.0f*(6.28318530718f/(float)_CPR)/rawPeriod; + return _ppairs*GetMechVelocity(); } float PositionSensorEncoder::GetMechVelocity(){