hobbyking_cheetah source code modified 2020/12/15
Dependencies: mbed-dev-f303 FastPWM3
Diff: PositionSensor/PositionSensor.h
- Revision:
- 14:80ce59119d93
- Parent:
- 13:a3fa0a31b114
- Child:
- 20:bf9ea5125d52
diff -r a3fa0a31b114 -r 80ce59119d93 PositionSensor/PositionSensor.h --- a/PositionSensor/PositionSensor.h Sun May 22 03:47:40 2016 +0000 +++ b/PositionSensor/PositionSensor.h Mon Oct 31 16:48:16 2016 +0000 @@ -27,9 +27,9 @@ float _offset, MechPosition, dir, test_pos, vel_old, out_old; }; -class PositionSensorSPI: public PositionSensor{ +class PositionSensorMA700: public PositionSensor{ public: - PositionSensorSPI(int CPR, float offset, int ppairs); + PositionSensorMA700(int CPR, float offset, int ppairs); virtual float GetMechPosition(); virtual float GetElecPosition(); virtual float GetMechVelocity(); @@ -41,4 +41,21 @@ SPI *spi; DigitalOut *cs; }; + +class PositionSensorAM5147: public PositionSensor{ +public: + PositionSensorAM5147(int CPR, float offset, int ppairs); + virtual float GetMechPosition(); + virtual float GetElecPosition(); + virtual float GetMechVelocity(); + virtual int GetRawPosition(); + virtual void ZeroPosition(); +private: + float _offset, MechPosition, MechOffset; + int _CPR, rotations, old_counts, _ppairs; + SPI *spi; + DigitalOut *cs; + int readAngleCmd; + +}; #endif \ No newline at end of file