Exercises
Try these further ideas to enhance your learning from this chapter:
- Sketch out another simple path and write code for the robot to follow it. For example, try to follow a figure-of-8 shape using your experience.
- Which methods would you add to the
Robot
object if you had an additional output to control, perhaps a single light-emitting diode (LED)? - Consider how you would lay out a
Robot
object for a robot with kart-style steering. Which methods would it have? You don't need to write the code yet, but having an interface in mind is a good start. Hint—it probably has one motor speed for the drive and a motor position for the steering.