Let's code the robot to move on a specific path
Do the setup as shown in Figure 8.117. R2-D2 is on a rescue mission for his master – Padme. R2-D2 needs to reach the computer system in under 5 seconds and turn it off by moving his head 180 degrees after reaching the spot. Once done, display Padme Saved! Mission Successful and play Hooray:
The sample code for this activity is given here:
Now, let's move on to a challenge.