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.
Fork of foc-ed_in_the_bot_compact by
Diff: PositionSensor/PositionSensor.h
- Revision:
- 0:bac9c3a3a6ca
- Child:
- 5:efd3838b79a6
- Child:
- 8:70122bad5f90
- Child:
- 9:074575151e4b
diff -r 000000000000 -r bac9c3a3a6ca PositionSensor/PositionSensor.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/PositionSensor/PositionSensor.h Wed Mar 09 06:44:51 2016 +0000
@@ -0,0 +1,26 @@
+#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;
+ void ZeroEncoderCount(void);
+ int _CPR;
+ int state;
+ float _offset;
+};
+
+#endif
\ No newline at end of file
