This activity is extra and will not be graded. Although, it is pretty fun to program.
You will need two robots for this activity. One of your robots will be tasked with staying inside a circle made out of a black line.
The second robot will mimic the movements of the first robot without being inside the circle.
First, program your first robot to stay within a black line. Follow the pseudo-code below:
- Turn on line tracker
- If line tracker is on black then transmit data, move backwards, and then turn a bit to the right or left.
- Else, go forward
- Loop steps 2 and 3
Next, program your second robot to move forward unless it receives data from the first robot. Follow the pseudo-code below:
- Receive data
- If data says there is a black line then, move backwards, and then turn a bit to the right or left. Make sure it is the same movement the first robot does.
- Else, go forward. Make sure it is the same speed as the first robot.
- Loop steps 1-3