In this case, students will create a program that uses the Color Sensor to stop the motors when it detects the color red. Point out that the Wait Block can be configured to be triggered by multiple colors, or just one. Students will need to use the Wait Block to do this. Robot Educator > Hardware > Color Sensor - Color
![robotc sample code robotc sample code](http://image.slideserve.com/783580/solution-code-l.jpg)
Refer students to the Robot Educator Tutorials for further assistance. Encourage them to use text, videos, images, sketchnotes, or another creative medium.
ROBOTC SAMPLE CODE CODE
Placing their code inside a loop allows for the possibility of multiple “traffic lights” along a track.Īllow the students to select the tool(s) they find most appropriate for capturing and sharing their pseudocode. Have the students simulate a vehicle’s behavior at traffic lights by having their wheeled robot respond to a series of green and red signals. The students will begin exploring the function of the Color Sensor that recognizes LEGO ® brick colors by programming their wheeled robot to drive along a path and stop at a red brick. Have the students begin a new project in the EV3 programming environment. Are the wires correctly connected from the Color Sensor to port 3?.Have the students perform the following building check before they program their robots: