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:
- 14:80ce59119d93
- Parent:
- 13:a3fa0a31b114
- Child:
- 20:bf9ea5125d52
--- a/PositionSensor/PositionSensor.h	Sun May 22 03:47:40 2016 +0000
+++ b/PositionSensor/PositionSensor.h	Mon Oct 31 16:48:16 2016 +0000
@@ -27,9 +27,9 @@
     float _offset, MechPosition, dir, test_pos, vel_old, out_old;
 };
 
-class PositionSensorSPI: public PositionSensor{
+class PositionSensorMA700: public PositionSensor{
 public:
-    PositionSensorSPI(int CPR, float offset, int ppairs);
+    PositionSensorMA700(int CPR, float offset, int ppairs);
     virtual float GetMechPosition();
     virtual float GetElecPosition();
     virtual float GetMechVelocity();
@@ -41,4 +41,21 @@
     SPI *spi;
     DigitalOut *cs;
 };
+
+class PositionSensorAM5147: public PositionSensor{
+public:
+    PositionSensorAM5147(int CPR, float offset, int ppairs);
+    virtual float GetMechPosition();
+    virtual float GetElecPosition();
+    virtual float GetMechVelocity();
+    virtual int GetRawPosition();
+    virtual void ZeroPosition();
+private:
+    float _offset, MechPosition, MechOffset;
+    int _CPR, rotations, old_counts, _ppairs;
+    SPI *spi;
+    DigitalOut *cs;
+    int readAngleCmd;
+
+};
 #endif
\ No newline at end of file