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
Revision 51:11cf80a2d899, committed 2019-04-05
- Comitter:
- QiayuanLiao
- Date:
- Fri Apr 05 03:46:51 2019 +0000
- Parent:
- 50:ba72df25d10f
- Commit message:
- For AS5147P
Changed in this revision
| PositionSensor/PositionSensor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PositionSensor/PositionSensor.cpp Thu Apr 04 13:53:58 2019 +0000
+++ b/PositionSensor/PositionSensor.cpp Fri Apr 05 03:46:51 2019 +0000
@@ -27,10 +27,9 @@
void PositionSensorAM5147::Sample(float dt){
GPIOA->ODR &= ~(1 << 15);
- //raw = spi->write(readAngleCmd);
- //raw &= 0x3FFF;
- raw = spi->write(0);
- raw = raw>>2; //Extract last 14 bits
+ raw = spi->write(readAngleCmd);
+ raw &= 0x3FFF;
+ //Extract last 14 bits
GPIOA->ODR |= (1 << 15);
int off_1 = offset_lut[raw>>7];
int off_2 = offset_lut[((raw>>7)+1)%128];