Retractable steering wheel
Dependencies: DebounceIn EthernetInterface PinDetect mbed-rtos mbed
Revision 5:bda4be356312, committed 2016-08-05
- Comitter:
- awatt196
- Date:
- Fri Aug 05 10:42:10 2016 +0000
- Parent:
- 4:9480e12a2e08
- Commit message:
- APM version
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jul 21 14:48:35 2016 +0000 +++ b/main.cpp Fri Aug 05 10:42:10 2016 +0000 @@ -18,11 +18,11 @@ //**********FIRGELLI**********// //**********SCREW**********// -DigitalOut dir(PTC17); //PTE24 not on shield +DigitalOut dir(PTD2); DigitalOut step(PTD0); -DigitalOut motor_power(PTB3); //PTB20 not on shield +DigitalOut motor_power(PTB3); DebounceIn switch_top(PTC3); //top limit switch -DebounceIn switch_bottom(PTC2); //bottom limit switch - PTC5 not on shield +DebounceIn switch_bottom(PTC2); //bottom limit switch void motor_power_function(int on_off); //on=1, off=0 void stop_top(); void stop_bottom(); @@ -38,7 +38,7 @@ //**********SEAT**********// //**********SYSTEM**********// -PinDetect reset_switch(PTC16); //PTB18 not on shield +PinDetect reset_switch(PTC16); //void reset_system(); //resets system in case of fault //**********SYSTEM**********// @@ -49,7 +49,7 @@ { pc.printf("extend\r\n"); extend_timer.start(); - while(extend_timer.read() < 7) + while(extend_timer.read() < 6) { extend = 1; retract = 0; @@ -65,7 +65,7 @@ { pc.printf("retract\r\n"); retract_timer.start(); - while(retract_timer.read() < 7) + while(retract_timer.read() < 6) { extend = 0; retract = 1; @@ -91,7 +91,7 @@ } else { - sitting = false; //person is sitting, therfore stop movement of steering wheel + sitting = false; //person is sitting, therefore stop movement of steering wheel //change to true } @@ -121,7 +121,7 @@ pc.printf("stop_top\r\n"); step=0; motor_power_function(0); - wait(2); + wait(0.5); extend_actuator(); //extend actuator once the gantry reaches the top } @@ -218,7 +218,7 @@ printf("switch_top = %d\r\n", switch_top.read()); printf("switch_bottom = %d\r\n", switch_bottom.read()); - //initial check to put steering wheel in retracted position + //initial check to put steering wheel in deployed position printf("Checking initial state...\r\n"); printf("Initial state is "); if (switch_top == 1)