Stepper motor

Dependencies:   StepperMotorUni mbed

Files at this revision

API Documentation at this revision

Comitter:
Voldread
Date:
Thu Oct 08 16:15:32 2015 +0000
Commit message:
Stepper motor

Changed in this revision

StepperMotorUni.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 1f4ed94b7b01 StepperMotorUni.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StepperMotorUni.lib	Thu Oct 08 16:15:32 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/okano/code/StepperMotorUni/#93f9ce526f38
diff -r 000000000000 -r 1f4ed94b7b01 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 08 16:15:32 2015 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+
+
+BusOut steps (PA_7, PB_6, PC_7, PA_9);
+
+
+int main() 
+{
+    int i=0;
+    int svar;
+    
+    printf("Tast 0 for med klokka, tast 1 for mot klokka\n");
+    scanf("%d",&svar);
+
+    if(svar==0)
+    {
+    for (i=0;i<512;i++) 
+        {
+        steps=0x9;
+        wait_ms(5);
+        steps=0xC;
+        wait_ms(5);
+        steps=0x6;
+        wait_ms(5);
+        steps=0x3;
+        wait_ms(5);
+        }
+    }
+
+    else if(svar==1)
+   {
+    for (i=0;i<512;i++) 
+        {
+        steps=0x3;
+        wait_ms(5);
+        steps=0x6;
+        wait_ms(5);
+        steps=0xC;
+        wait_ms(5);
+        steps=0x9;
+        wait_ms(5);
+        }
+    }
+ }    
+    
+
+
diff -r 000000000000 -r 1f4ed94b7b01 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 08 16:15:32 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file