Alan Simms / threeAxis
Revision:
0:603f46a29b61
Child:
1:43d856fad23a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/threeAxis.h	Wed Dec 15 00:01:51 2021 +0000
@@ -0,0 +1,71 @@
+class threeAxis{
+    public:
+        threeAxis(PinName xStep, PinName yStep, PinName zStep, PinName xDir, PinName yDir, PinName zDir, PinName xEnable, PinName yEnable, PinName zEnable, float stepRatio, float xBound, float yBound, float zBound, PinName xLimit, PinName yLimit, PinName zLimit);
+        int goTo(float xVal, float yVal, float zVal);
+        int goToRaw(int xVal, int yVal, int zVal);
+        
+        void stepBackX();
+        void stepBackY();
+        void stepBackZ();
+        
+        void setZero();
+        
+        void setZeroX();
+        void setZeroY();
+        void setZeroZ();
+        
+        void zeroX();
+        void zeroY();
+        void zeroZ();
+        
+        void setWait(int waitPer);
+        
+        void setXdir(bool val);
+        void setYdir(bool val);
+        void setZdir(bool val);
+        
+        void invertX();
+        void invertY();
+        void invertZ();
+        
+        void setLimits(bool val);
+        
+    protected:
+        int toX;
+        int toY;
+        int toZ;
+        
+        int currX;
+        int currY;
+        int currZ;
+        
+        DigitalOut _xStep;
+        DigitalOut _yStep;
+        DigitalOut _zStep;
+        
+        DigitalOut _xDir;
+        DigitalOut _yDir;
+        DigitalOut _zDir;
+        
+        DigitalOut _xEnable;
+        DigitalOut _yEnable;
+        DigitalOut _zEnable;
+        
+        DigitalIn _xLimit;
+        DigitalIn _yLimit;
+        DigitalIn _zLimit;
+        
+        float _stepRatio;
+        
+        float _xMax;
+        float _yMax;
+        float _zMax;
+        
+        bool limitsEnabled;
+        
+        bool defaultXdir;
+        bool defaultYdir;
+        bool defaultZdir;
+        
+        int wait;
+};
\ No newline at end of file