Task 2) Open basecontroller.c and the samplecontroller.c.
As we want to use functions, rather than one big loop. You will need to refactor the int main() function in the basecontroller.c. Any static variables or constants which are used to set up the robot need be move to the static void initialize() function is the samplecontroller.c after line 41. Any global variables should be moved to the top of the code after line 24. If you have done this correctly, your robot will now move forward is a straight line. You will notice the console printing out a message giving you the values of red and blue. These values start at 100 and decrease by around 1 per second. If they hit 0, the simulation ends. The robot can recover these variables using the resources we will implement next.