tuning before challenge

main
Simon Frei 4 years ago
parent 949b936ed6
commit 6d8603c454
  1. 15
      ADIS_Sumo/Sumo/Application.c
  2. 6
      ADIS_Sumo/Sumo/Turn.c

@ -389,19 +389,20 @@ static void StateMachine(bool buttonPress) {
// McuShell_SendStr((unsigned char*)"\r\n", McuESP32_GetTxToESPStdio()->stdOut);
appState = APP_STATE_IDLE;
mazeFailure=0;
}else if(!LF_IsFollowing() && !MAZE_IsSolved() && mazeFailure < 5){
}else if(!LF_IsFollowing() && !MAZE_IsSolved()){// && mazeFailure < 5){
// failed
mazeFailure++;
// mazeFailure++;
MAZE_ClearSolution();
DRV_SetSpeed(0, 0);
DRV_SetMode(DRV_MODE_SPEED);
LF_StartFollowing();
}else if(!LF_IsFollowing() && !MAZE_IsSolved() && mazeFailure >= 5){
BUZ_Beep(1000, 1000);
McuShell_SendStr((unsigned char*)"mqtt publish \"/mobile/status/mode/\" \"FAILURE\"\r\n", McuESP32_GetTxToESPStdio()->stdOut);
// McuShell_SendStr((unsigned char*)"\r\n", McuESP32_GetTxToESPStdio()->stdOut);
appState = APP_STATE_IDLE;
}
// }else if(!LF_IsFollowing() && !MAZE_IsSolved() && mazeFailure >= 5){
// BUZ_Beep(1000, 1000);
// McuShell_SendStr((unsigned char*)"mqtt publish \"/mobile/status/mode/\" \"FAILURE\"\r\n", McuESP32_GetTxToESPStdio()->stdOut);
//// McuShell_SendStr((unsigned char*)"\r\n", McuESP32_GetTxToESPStdio()->stdOut);
// appState = APP_STATE_IDLE;
// }
if(MAZE_GetPresentCount() != presentCnt){
presentCnt = MAZE_GetPresentCount();
//publish

@ -63,11 +63,11 @@
#define TURN_STEPS_POST_LINE_TIMEOUT_MS 500
#define TURN_STEPS_STOP_TIMEOUT_MS 150
#elif PL_IS_INTRO_ZUMO_K22 /* no LiPo */
#define TURN_STEPS_90 650//720
#define TURN_STEPS_90 720
/*!< number of steps for a 90 degree turn */
#define TURN_STEPS_LINE 170//100 /*230*/
#define TURN_STEPS_LINE 100 /*230*/
/*!< number of steps stepping over the line */
#define TURN_STEPS_POST_LINE 240//150
#define TURN_STEPS_POST_LINE 150
/*!< number of steps after the line, before making a turn */
#define TURN_STEPS_90_TIMEOUT_MS 1000
#define TURN_STEPS_LINE_TIMEOUT_MS 200

Loading…
Cancel
Save