hh

Dependencies:   FastPWM3

Committer:
benkatz
Date:
Fri Feb 05 01:04:57 2016 +0000
Revision:
1:b8bceb4daed5
Parent:
0:4e1c4df6aabd
Child:
3:6a0015d88d06
Added some comments, cleaned things up a bit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
benkatz 0:4e1c4df6aabd 1 #ifndef POSITIONSENSOR_H
benkatz 0:4e1c4df6aabd 2 #define POSITIONSENSOR_H
benkatz 0:4e1c4df6aabd 3
benkatz 0:4e1c4df6aabd 4 class PositionSensor {
benkatz 0:4e1c4df6aabd 5 public:
benkatz 0:4e1c4df6aabd 6 virtual float GetMechPosition() {return 0.0f;}
benkatz 0:4e1c4df6aabd 7 virtual float GetElecPosition() {return 0.0f;}
benkatz 0:4e1c4df6aabd 8 };
benkatz 0:4e1c4df6aabd 9
benkatz 0:4e1c4df6aabd 10
benkatz 0:4e1c4df6aabd 11 class PositionSensorEncoder: public PositionSensor {
benkatz 0:4e1c4df6aabd 12 public:
benkatz 0:4e1c4df6aabd 13 PositionSensorEncoder(int CPR, float offset);
benkatz 0:4e1c4df6aabd 14 virtual float GetMechPosition();
benkatz 0:4e1c4df6aabd 15 virtual float GetElecPosition();
benkatz 0:4e1c4df6aabd 16 private:
benkatz 0:4e1c4df6aabd 17 InterruptIn *ZPulse;
benkatz 0:4e1c4df6aabd 18 DigitalIn *ZSense;
benkatz 1:b8bceb4daed5 19 //DigitalOut *ZTest;
benkatz 0:4e1c4df6aabd 20 virtual void ZeroEncoderCount(void);
benkatz 0:4e1c4df6aabd 21 int _CPR;
benkatz 1:b8bceb4daed5 22 //int state;
benkatz 0:4e1c4df6aabd 23 float _offset;
benkatz 0:4e1c4df6aabd 24 };
benkatz 0:4e1c4df6aabd 25
benkatz 0:4e1c4df6aabd 26 #endif