|
|
|
|
@ -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
|
|
|
|
|
|