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.
Dependencies: mbed X_NUCLEO_IHM01A1
Diff: main.cpp
- Revision:
- 2:e12e4df7a486
- Parent:
- 1:fbf28f3367aa
- Child:
- 3:02d9ec4f88b2
diff -r fbf28f3367aa -r e12e4df7a486 main.cpp
--- a/main.cpp Fri Oct 16 13:51:31 2015 +0000
+++ b/main.cpp Fri Nov 13 12:59:29 2015 +0000
@@ -87,7 +87,7 @@
printf("--> Moving forward %d steps.\r\n", ROUND_ANGLE_STEPS);
/* Moving N steps in the forward direction. */
- motor->Move(FORWARD, ROUND_ANGLE_STEPS);
+ motor->Move(StepperMotor::CW, ROUND_ANGLE_STEPS);
/* Waiting while the motor is active. */
motor->WaitWhileActive();
@@ -108,7 +108,7 @@
printf("--> Moving backward %d steps.\r\n", ROUND_ANGLE_STEPS);
/* Moving N steps in the backward direction. */
- motor->Move(BACKWARD, ROUND_ANGLE_STEPS);
+ motor->Move(StepperMotor::CCW, ROUND_ANGLE_STEPS);
/* Waiting while the motor is active. */
motor->WaitWhileActive();
@@ -174,13 +174,13 @@
printf("--> Moving backward.\r\n");
/* Requesting to run backward. */
- motor->Run(BACKWARD);
+ motor->Run(StepperMotor::CCW);
/* Waiting until delay has expired. */
wait_ms(6000);
/* Getting current speed. */
- int speed = motor->GetCurrentSpeed();
+ int speed = motor->GetSpeed();
/* Printing to the console. */
printf(" Speed: %d.\r\n", speed);
@@ -198,7 +198,7 @@
wait_ms(6000);
/* Getting current speed. */
- speed = motor->GetCurrentSpeed();
+ speed = motor->GetSpeed();
/* Printing to the console. */
printf(" Speed: %d.\r\n", speed);
@@ -216,7 +216,7 @@
wait_ms(8000);
/* Getting current speed. */
- speed = motor->GetCurrentSpeed();
+ speed = motor->GetSpeed();
/* Printing to the console. */
printf(" Speed: %d.\r\n", speed);
@@ -228,7 +228,7 @@
printf("--> Moving forward.\r\n");
/* Requesting to run in forward direction. */
- motor->Run(FORWARD);
+ motor->Run(StepperMotor::CW);
/* Waiting until delay has expired. */
wait_ms(4000);