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:
- 5:51c6560bf624
- Parent:
- 3:6a0015d88d06
- Child:
- 6:4ee1cdc43aa8
--- a/PositionSensor/PositionSensor.cpp Sat Mar 12 08:04:51 2016 +0000 +++ b/PositionSensor/PositionSensor.cpp Sat Mar 12 18:45:22 2016 +0000 @@ -70,7 +70,7 @@ int raw = TIM3->CNT-0x8000; if (raw < 0) raw += _CPR; if (raw >= _CPR) raw -= _CPR; - float signed_mech = fmod(((6.28318530718f*(raw)/(float)_CPR + _offset)), 6.28318530718f); //7 pole pairs + float signed_mech = fmod(((6.28318530718f*(raw)/(float)_CPR + _offset)), 6.28318530718f); if (signed_mech < 0){ return signed_mech + 6.28318530718f; }