Movement Challenge

Once you are able to make your robot move forward and turn as desired, challenge yourself by programming your robot to do the following. You may need to work through some of the Khan Academy or Code.org programming tutorials to get a better handle on programming prior to attempting this challenge. Feel free to ask questions. This is a difficult challenge. You are not expected to complete it independently.
  • Create a square() function that will make your robot trace the path of a square.
  • If you haven't already, use a for loop to eliminate any repetitive code. (In addition to learning about for loops via Khan Academy or Code.org, you can also refer to the Reference section of the Arduino website).
  • Modify your function to include an argument to control the size of the square.
  • Create a similar function to trace the path of an equilateral triangle.
  • Create a polygon function with arguments to control the size and number of sides.
Comments