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.
Diff: PositionSensor/PositionSensor.h
- Revision:
- 8:10ae7bc88d6e
- Parent:
- 7:dc5f27756e02
- Child:
- 9:d7eb815cb057
--- a/PositionSensor/PositionSensor.h Tue Mar 29 01:05:46 2016 +0000
+++ b/PositionSensor/PositionSensor.h Wed Apr 13 04:09:56 2016 +0000
@@ -1,6 +1,5 @@
#ifndef POSITIONSENSOR_H
#define POSITIONSENSOR_H
-
class PositionSensor {
public:
virtual float GetMechPosition() {return 0.0f;}
@@ -26,4 +25,15 @@
float _offset, MechPosition, dir, test_pos;
};
+class PositionSensorSPI: public PositionSensor{
+public:
+ PositionSensorSPI(int CPR, float offset);
+ virtual float GetMechPosition();
+ virtual float GetElecPosition();
+private:
+ float _offset, MechPosition;
+ int _CPR, rotations, old_counts;
+ SPI *spi;
+ DigitalOut *cs;
+};
#endif
\ No newline at end of file