6.6 Schrittmotor bis zum Endschalter laufen lassen, Nullpunkt setzen, 10 x 100 Schritte vorwärts und in einem Lauf zurück auf die Nullposition. Zusätzlich einen Button als Notaus (Soforthalt) vorsehen.

Dependencies:   StepperMotorUni mbed

Fork of 06-13-Uebung by th.iotkit1.ch

Revision:
0:ae2206213141
Child:
1:1330fe477c67
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jan 19 11:01:48 2014 +0000
@@ -0,0 +1,26 @@
+/** "Hello" program for StepperMotorUni class library
+ *
+ *  very simple sample of "StepperMotorUni" operation 
+ * 
+ *  version 1.0
+ *  copyright: 2014 Tedd OKANO
+ *  released under the Apache 2 license License
+ */
+
+#include "mbed.h"
+#include "StepperMotorUni.h"
+
+StepperMotorUni motor( p26, p25, p24, p23 );
+
+int main()
+{
+    motor.set_pps( 50 );
+
+    while ( 1 ) {
+        motor.move_steps( 24 );
+        wait( 1 );
+
+        motor.move_steps( -24 );
+        wait( 1 );
+    }
+}