motore cofano
Dependencies: mbed X-NUCLEO-IHM05A1
Revision 11:a7e099ee909e, committed 2018-11-21
- Comitter:
- francesco01
- Date:
- Wed Nov 21 15:52:33 2018 +0000
- Parent:
- 10:2622d1ab5984
- Commit message:
- motore
Changed in this revision
Exercise_IHM05A1.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2622d1ab5984 -r a7e099ee909e Exercise_IHM05A1.cpp --- 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);