hobbyking_cheetah source code modified 2020/12/15
Dependencies: mbed-dev-f303 FastPWM3
Diff: PositionSensor/PositionSensor.cpp
- Revision:
- 20:bf9ea5125d52
- Parent:
- 14:80ce59119d93
- Child:
- 22:60276ba87ac6
--- a/PositionSensor/PositionSensor.cpp Tue Feb 14 03:28:16 2017 +0000 +++ b/PositionSensor/PositionSensor.cpp Thu Mar 02 15:31:23 2017 +0000 @@ -66,7 +66,7 @@ rotations = 0; spi = new SPI(PC_12, PC_11, PC_10); spi->format(16, 1); - spi->frequency(10000000); + spi->frequency(5000000); cs = new DigitalOut(PA_15); cs->write(1); readAngleCmd = 0xffff; @@ -118,6 +118,8 @@ MechOffset = GetMechPosition(); } + + PositionSensorEncoder::PositionSensorEncoder(int CPR, float offset, int ppairs) { _ppairs = ppairs; _CPR = CPR;