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.
PositionSensor/PositionSensor.h
- Committer:
- benkatz
- Date:
- 2016-02-05
- Revision:
- 0:4e1c4df6aabd
- Child:
- 1:b8bceb4daed5
File content as of revision 0:4e1c4df6aabd:
#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(); private: InterruptIn *ZPulse; DigitalIn *ZSense; DigitalOut *ZTest; virtual void ZeroEncoderCount(void); int _CPR; int state; float _offset; }; #endif