Before attempting any problem for this challenge, write a general code such that the robot will always follow conditions stated below:
The robot's top LED (red color) always blinking while the robot is moving backwards.
The robot's led0 always turns on when the robot is turning left.
The robot's led7 always turns on when the robot is turning right.
For every problem in this challenge, attempt to use this general code.
Assign a variable for each wheel's speed.
Use if / elif statements. When the robot is moving backwards, the values of both wheels are negative. When the robot is turning, one of the values is zero.
Write a code such that for any setup, the robot will :
Pathfind and follow the white part of the ground marker
Not cross the black part of the ground marker
Move forward if the ground marker is not present
Move backwards if an obstacle is blocking the robot's path
and also follow the following rules:
The robot's top LED (red color) always blinking while the robot is moving backwards.
The robot's led0 always turns on when the robot is turning left.
The robot's led7 always turns on when the robot is turning right.
Create a maze that only has one entrance and one exit where the white part of the ground marker is the road of the maze.
Put the robot at the entrance.
Write a code such that the robot will always find the way out of the maze.
and also follow the following rules:
The robot's top LED (red color) always blinking while the robot is moving backwards.
The robot's led0 always turns on when the robot is turning left.
The robot's led7 always turns on when the robot is turning right.
If the backward button is pressed, the loop is terminated and the program will stop
After the robot has exited the maze, create another maze and run the same code to check if the previous code is able to make the robot escapes any kind of maze.
If the robot always turns right at every corner, it will eventually find the exit. (although at a slow pace)