TASK 4: FOLLOW LINE
OBJECTIVE The objective of this task is to cover the following parts: Follow the line as fast as possible IOT communication through MQTT Serial communication between ESP and Arduino If the robot loses the line, can find it again Detect obstacles HOW HAVE WE DONE IT? FOLLOW LINE In this part we were interested in using FreeRTOS so, to follow the line in the Elegoo robot we have created 2 tasks: get_infrared: used for controlling the infrared module, 100 words in the stack and the priority is 2. command_motors: used for controlling the motors“ speed, 100 words in the stack and the priority is 2. In get_infrared you can find 3 analog reads from each pin (left, middle and right) and we have defined the 6 possible situations: Also, for the PD we have created for controlling the motors (we are going to make a deep explanation of it, down below) in each case we have introduced a global variable called: error . The error is 0 when there is NO LINE or...