motore cofano

Dependencies:   mbed X-NUCLEO-IHM05A1

Revision:
11:a7e099ee909e
Parent:
10:2622d1ab5984
--- a/Exercise_IHM05A1.cpp	Sat Nov 17 14:19:06 2018 +0000
+++ b/Exercise_IHM05A1.cpp	Wed Nov 21 15:52:33 2018 +0000
@@ -158,16 +158,7 @@
   pc.printf("--> Running the motor backward.\r\n");
   motor->run(StepperMotor::BWD);
   
-  while (motor->get_status()!=STEADY) {
-    /* Print reached speed to the console in step/s or microsteps/s */
-    pc.printf("    Reached Speed: %d microstep/s.\r\n", motor->get_speed());
-    wait_ms(50);    
-  }
-  pc.printf("    Reached Speed: %d microstep/s.\r\n", motor->get_speed());
-     
-  /* Wait for 1 second */  
-  wait_ms(1000);
-  
+ 
 
   
 //----- Soft stop required while running
@@ -199,7 +190,7 @@
   
   while (true) {
   
-  if ( Input == 0 ) 
+ /* if ( Input == 0 ) 
   {
      a=a+1;
    }
@@ -207,9 +198,9 @@
    {
     a=0;
      
-   }
+   }*/
          
-     if(a==0)
+     if(myButton==0)
      {
         /* Request device to go position -3200 */
         motor->go_to(150);