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: Stepper.cpp
- Revision:
- 0:6e7505d77f6a
- Child:
- 1:52716241d0c4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Stepper.cpp Sat Apr 21 05:48:28 2012 +0000
@@ -0,0 +1,18 @@
+#include "Stepper.h"
+
+Stepper::Stepper(PinName step, PinName dir, PinName en) : _step(step), _dir(dir), _en(en) {
+ _step = 0, _dir = 0, _en = 1;
+}
+
+void Stepper::stepOn(bool direction) {
+ _dir = direction;
+ _step = 1;
+}
+
+void Stepper::stepOff(void) {
+ _step = 0;
+}
+
+void Stepper::enable(bool en) {
+ _en = !en;
+}
\ No newline at end of file