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 Robot2016_2-0 by
Diff: StepperMotor/Stepper.h
- Revision:
- 58:02dc8328975a
- Child:
- 71:5590dbe8393a
diff -r dfeee9e5c0af -r 02dc8328975a StepperMotor/Stepper.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/StepperMotor/Stepper.h Wed May 04 19:55:03 2016 +0000
@@ -0,0 +1,27 @@
+#ifndef MBED_STEPPER_H
+#define MBED_STEPPER_H
+
+#include "mbed.h"
+
+class Stepper
+{
+public:
+ Stepper(PinName _en, PinName _stepPin, PinName dir, PinName _minEndStop, float step_per_mm);
+ void step(int number, int dir, float speed);
+ void mm(int number, int dir);
+ void mm(float distance);
+ void enable();
+ void disable();
+
+ int getEndStop() {return minEndStop.read();}
+
+ float Step_Per_MM;
+private:
+ DigitalOut en;
+ DigitalOut stepPin;
+ DigitalOut direction;
+ DigitalIn minEndStop;
+};
+
+
+#endif
\ No newline at end of file
