CHAPTER 6: Traffic Signal Challenge

CHAPTER 6: Traffic Signal Challenge
In this challenge, you will program your EV3 robot to through three different intersection, each of which
has a traffic signal. The traffic signal, which can be either the colored block or the red/green card, is held by
hand at a set height. Unlike a camera, the detection range of the Color Sensor is short, so you will need to
modify its placement on the robot so that it can see the traffic signal and react appropiately.
Rules and Procedures:
• Traffic signals are represented by holding the
colored block with the signal side downward
and toward the robot at a 45-degree angle.
• You can also use red and green colored sheets
of paper, which may be easier to hold at the
correct height.
• The initial signal color for each intersection is
determined by flipping three coins before the
run. Heads = Green, Tails = Red.
• The robot MUST stop if the light is red, and
MUST NOT stop if the light is green.
• After the robot successfully gotten through all
three intersections, the robot can be stopped
by hand.
• BONUS: Write the program so that it DOES
always stop after going through the third
intersection. This will require the use of a
Switch.
Hints:
• Since you only have access to Wait commands, try to break the robot’s behavior into stages. What is the
robot waiting to see at each stage of its movement? What should its motors be doing during those stages?
• If the robot is already moving, is there any point in waiting for Green? If the robot is stopped, is there any
point in waiting for Red?
• If the robot sees a Red light, don’t forget that it needs to wait for the actual Green light before proceeding!
Download PDF

advertising