MOTOR PASO A PASO

Dependencies:   mbed sMotor

Fork of Stepper_4 by Nuno Sarmento

Files at this revision

API Documentation at this revision

Comitter:
pablolopez89
Date:
Tue Apr 10 00:12:59 2018 +0000
Parent:
0:6999a083fb46
Commit message:
MOTOR PASO A PASO

Changed in this revision

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 6999a083fb46 -r be5a5f38621d main.cpp
--- a/main.cpp	Thu Jun 14 12:18:18 2012 +0000
+++ b/main.cpp	Tue Apr 10 00:12:59 2018 +0000
@@ -14,7 +14,7 @@
 
 
 Serial pc(USBTX, USBRX);
-sMotor motor(p9, p10, p11, p12); // creates new stepper motor: IN1, IN2, IN3, IN4
+sMotor motor(PC_7, PB_6, PA_7, PA_6); // creates new stepper motor: IN1, IN2, IN3, IN4
 
 int step_speed = 1200 ; // set default motor speed
 int numstep = 512 ; // defines full turn of 360 degree
@@ -24,17 +24,17 @@
 int main() {
 
     //Credits
-    printf("4 Phase Stepper Motor v0.1 - Test Program\r\n");
-    printf("developed by Samuel Matildes\r\n");
-    printf("\n\r");
+    pc.printf("4 Phase Stepper Motor v0.1 - Test Program\r\n");
+    pc.printf("developed by Samuel Matildes\r\n");
+    pc.printf("\n\r");
 
     // Screen Menu
-    printf("Default Speed: %d\n\r",step_speed);
-    printf("1- 360 degree clockwise step\n\r");
-    printf("2- 360 degree anticlockwise step\n\r");
-    printf("3- 180 degree clockwise step\n\r");
-    printf("4- 180 degree anticlockwise step\n\r");
-    printf("5- Change Speed\n\r");
+    pc.printf("Default Speed: %d\n\r",step_speed);
+    pc.printf("1- 360 degree clockwise step\n\r");
+    pc.printf("2- 360 degree anticlockwise step\n\r");
+    pc.printf("3- 180 degree clockwise step\n\r");
+    pc.printf("4- 180 degree anticlockwise step\n\r");
+    pc.printf("5- Change Speed\n\r");
 
     while (1) {
 
@@ -53,8 +53,8 @@
                 motor.step(numstep/2,1,step_speed);
 
             if (pc.getc()=='5') {
-                printf("Current Speed: %d\n\r", step_speed);
-                printf("New speed: \n\r");
+                pc.printf("Current Speed: %d\n\r", step_speed);
+                pc.printf("New speed: \n\r");
                 pc.scanf("%d",&step_speed); // sets new speed
             }
         }
diff -r 6999a083fb46 -r be5a5f38621d mbed.bld
--- a/mbed.bld	Thu Jun 14 12:18:18 2012 +0000
+++ b/mbed.bld	Tue Apr 10 00:12:59 2018 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479
+http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file