1

Dependencies:   X-NUCLEO-IHM05A1

Example code to use L6208 stepper motor driver with nucleo evaluation shield

Explanation: Run a test to determine the maximum speed of the motor at given current and acceleration Run the motor in position mode with microstepping and slow decay

Files at this revision

API Documentation at this revision

Comitter:
nucleosam
Date:
Fri Apr 29 14:59:26 2016 +0000
Parent:
1:868ccc44b373
Child:
3:a6e155687c6a
Commit message:
Removed inclusion of ?DevSPI.h?; Fixed comments.;

Changed in this revision

X-NUCLEO-IHM05A1.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-IHM05A1.lib	Wed Apr 27 16:36:29 2016 +0000
+++ b/X-NUCLEO-IHM05A1.lib	Fri Apr 29 14:59:26 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/X-NUCLEO-IHM05A1/#5cc2691ccfff
+https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/X-NUCLEO-IHM05A1/#2af31245e67e
--- a/main.cpp	Wed Apr 27 16:36:29 2016 +0000
+++ b/main.cpp	Fri Apr 29 14:59:26 2016 +0000
@@ -4,7 +4,7 @@
  * @author  IPC Rennes
  * @version V1.0.0
  * @date    April 13th, 2016
- * @brief   mbed simple application for the STMicroelectronics X-NUCLEO-IHM03A1
+ * @brief   mbed simple application for the STMicroelectronics X-NUCLEO-IHM05A1
  *          Motor Control Expansion Board: control of 1 motor.
  ******************************************************************************
  * @attention
@@ -41,9 +41,6 @@
 /* mbed specific header files. */
 #include "mbed.h"
 
-/* Helper header files. */
-#include "DevSPI.h"
-
 /* Component specific header files. */
 #include "l6208_class.h"
 
@@ -148,10 +145,10 @@
   while (motor->GetStatus()!=STEADY)
   {
     /* Print reached speed to the console in step/s or microsteps/s */
-    //printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());
-    //wait_ms(50);    
+    printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());
+    wait_ms(50);    
   }
-  //printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());
+  printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());
      
   /* Wait for 1 second */  
   wait_ms(1000);
@@ -165,10 +162,10 @@
   while (motor->GetStatus()!=STEADY)
   {
     /* Print reached speed to the console in step/s or microsteps/s */
-    //printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());
-    //wait_ms(50);    
+    printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());
+    wait_ms(50);    
   }
-  //printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());  
+  printf("    Reached Speed: %d microstep/s.\r\n", motor->GetSpeed());  
 
   /* Wait for 5 seconds */  
   wait_ms(5000);