Simple test application for the STMicroelectronics X-NUCLEO-IHM01A1 Stepper Motor Control Expansion Board, built against mbed OS.

Dependencies:   X_NUCLEO_IHM01A1

Fork of HelloWorld_IHM01A1_2Motors by ST

Motor Control with the X-NUCLEO-IHM01A1 Expansion Board

This application provides a simple example of usage of the X-NUCLEO-IHM01A1 Stepper Motor Control Expansion Board.
It shows how to use two stepper motors connected to two stacked boards in daisy chain configuration, moving the rotors to specific positions, with given speed values, directions of rotation, etc.

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Mon Dec 14 17:30:37 2015 +0000
Parent:
13:32a063c4bfbd
Child:
15:50c6f8635dfd
Commit message:
+ Updated with no initialization structure passed by default.

Changed in this revision

X_NUCLEO_IHM01A1.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
--- a/X_NUCLEO_IHM01A1.lib	Thu Dec 10 15:07:47 2015 +0000
+++ b/X_NUCLEO_IHM01A1.lib	Mon Dec 14 17:30:37 2015 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST/code/X_NUCLEO_IHM01A1/#40470df81d9a
+https://developer.mbed.org/teams/ST/code/X_NUCLEO_IHM01A1/#bec7dd79f328
--- a/main.cpp	Thu Dec 10 15:07:47 2015 +0000
+++ b/main.cpp	Mon Dec 14 17:30:37 2015 +0000
@@ -73,11 +73,11 @@
 
     /* Initializing Motor Control Components. */
     motor1 = new L6474(D2, D8, D7, D9, D10, dev_spi);
-    if (motor1->Init(NULL) != COMPONENT_OK)
-        return false;
+    if (motor1->Init() != COMPONENT_OK)
+        exit(EXIT_FAILURE);
     motor2 = new L6474(D2, D8, D4, D3, D10, dev_spi);
-    if (motor2->Init(NULL) != COMPONENT_OK)
-        return false;
+    if (motor2->Init() != COMPONENT_OK)
+        exit(EXIT_FAILURE);
 
     /* Printing to the console. */
     printf("Motor Control Application Example for 2 Motors\r\n\n");