Test the set param mode
PositionSensor/PositionSensor.h
- Committer:
- benkatz
- Date:
- 2016-03-29
- Revision:
- 7:dc5f27756e02
- Parent:
- 3:6a0015d88d06
- Child:
- 8:10ae7bc88d6e
File content as of revision 7:dc5f27756e02:
#ifndef POSITIONSENSOR_H #define POSITIONSENSOR_H class PositionSensor { public: virtual float GetMechPosition() {return 0.0f;} virtual float GetElecPosition() {return 0.0f;} }; class PositionSensorEncoder: public PositionSensor { public: PositionSensorEncoder(int CPR, float offset); virtual float GetMechPosition(); virtual float GetElecPosition(); virtual float GetMechVelocity(); virtual float GetElecVelocity(); private: InterruptIn *ZPulse; DigitalIn *ZSense; //DigitalOut *ZTest; virtual void ZeroEncoderCount(void); virtual void ZeroEncoderCountDown(void); int _CPR, flag, rotations; //int state; float _offset, MechPosition, dir, test_pos; }; #endif