Motion control example for 1 motor.
Dependencies: X_NUCLEO_IHM03A1 mbed
Fork of IHM03A1_ExampleFor1Motor by
This application provides an example of usage of the X-NUCLEO-IHM03A1 High Power Stepper Motor Control Expansion Board.
It shows how to use one stepper motor connected to the board by:
- moving the rotor a specific number of steps or to a specific position, with a given speed value, direction of rotation;
- monitoring the motor status;
- handling an interrupt triggered by the motor driver;
- getting and setting a motor driver parameter.
- etc.
For the hardware configuration of the expansion board, please refer to the X_NUCLEO_IHM03A1 home web page.
Diff: main.cpp
- Revision:
- 3:465d357bbce3
- Parent:
- 2:7e8485b5d57d
diff -r 7e8485b5d57d -r 465d357bbce3 main.cpp
--- a/main.cpp Wed Apr 13 08:53:45 2016 +0000
+++ b/main.cpp Wed Apr 13 09:01:05 2016 +0000
@@ -123,6 +123,7 @@
/* Get the value of the status register. */
unsigned int statusRegister = motor->GetStatus();
+ printf(" WARNING: \"FLAG\" interrupt triggered.\r\n");
/* Check HIZ flag: if set, power brigdes are disabled */
if ((statusRegister & POWERSTEP01_STATUS_HIZ)==POWERSTEP01_STATUS_HIZ)
{
