PlayBack
Dependencies: TPixy-Interface
Fork of ObjectFollower by
Diff: ui.cpp
- Revision:
- 4:417e475239c7
- Parent:
- 2:ca2a7430739b
- Child:
- 5:b29220d29022
- Child:
- 6:e7ce340fe91e
diff -r 4def4ca68910 -r 417e475239c7 ui.cpp --- a/ui.cpp Sat Feb 03 00:48:47 2018 +0000 +++ b/ui.cpp Fri Feb 09 18:37:11 2018 +0000 @@ -60,6 +60,7 @@ /****************************************************************************** User interface ******************************************************************************/ +/* void consoleUI(void) { if (bluetooth.readable()) { @@ -113,12 +114,12 @@ bluetooth.printf("\r\nPos: %d, dP: %d, dT: %d, Kp: %f, Ki: %f, vel: %d, e: %d", position, dPosition, xState, dTime, Kp, Ki, vel, e); } - +*/ /****************************************************************************** User interface 2 ******************************************************************************/ -void consoleUI2(void) +void consoleUI(void) { if (bluetooth.readable()) { @@ -139,7 +140,7 @@ if ( setpoint < 506 ) { //setpoint = setpoint + SPEED_STEP; - setpoint = 200; + setpoint = 400; } setpoint_mutex.unlock(); @@ -154,7 +155,7 @@ setpoint_mutex.lock(); if (setpoint > -560) { - setpoint = -200; + setpoint = -400; //setpoint = setpoint - SPEED_STEP; } @@ -163,21 +164,21 @@ // display speed bluetooth.printf("\r\n %5d", setpoint); } - else if (x=='e') + else if (x=='i') { - Ki = Ki + 0.005; + Ki = Ki + 0.001; } - else if (x=='d') + else if (x=='k') { - Ki = Ki - 0.005; + Ki = Ki - 0.001; } - else if (x=='t') + else if (x=='o') { - Kp = Kp + 0.05; + Kp = Kp + 0.01; } - else if (x=='g') + else if (x=='l') { - Kp = Kp - 0.05; + Kp = Kp - 0.01; } // error wrong input