The analog sensor max4466 pin A6 is always triggered regardless of the value entered in the window >= 0-1024. The robot executes commands in a loop.