Prova con controller motore
Dependencies: X-NUCLEO-IHM05A1 mbed
Fork of HelloWorld_IHM05A1 by
Diff: main.cpp
- Revision:
- 2:c5f455885df7
- Parent:
- 0:36aa6787d4f9
- Child:
- 3:a6e155687c6a
--- 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);