08 Mission Instructions

Your mission is to design a robot that can be the Traffic Light for a game of Red Light, Green Light. Then you can play alone or with your friends.  To be successful, your robot will need to:

      1. Randomly change between two different colored LEDs
      2. Sense motion during a "Red Light"
      3. Declare when the robot wins or loses

7. What Makes a Game?, part 2

In the last step you noticed that the robot needs to use its distance sensor to detect when you’re close enough to win the game. Robots can’t detect anything unless they have a specific sensor to do so. Since we’re using a distance sensor for this mission, you can be very close to the robot without needing to actually touch it.  We set our winning distance to be within 5 inches of the robot, but you can set your distance to be further or closer depending on your mood. You can even change the distance in between games to make them harder or easier to win!

Now, in order for the robot to win the game, it’ll need to sense you moving during a Red Light.  Right now our program starts with motion_detected as false. So, for the robot to win the game, motion_detected would need to become true. That will be our second logic function in our Until… Loop