EV3 Programming 1.3: How to detect color (Using Color Sensor)

Welcome to BlueAngel Robotics, my
name is Emma. In this video, I am going to teach you how to program this robot to detect the color “Red”. This is the EV3 color sensor. To make your color sensor work perfectly, make sure you position the sensor close to the surface, ideally, less than ½ inch.
or, about 1.3 centimeter. Now, let’s have some fun programming. First, drag and drop a “Move Steering” block on to the programing canvas and select “On” to turn on the motors. Let’s use only 10% of power for this task. Then, go to the orange “Flow Control” tab, drag a “Wait” block to the canvas. The “Wait” block makes your program wait for something to happen before the robot continues to the next programming block. The default value is to wait for “one” second. In this program, we want it to wait until the color sensor finds the color red. In order to do this, select “color sensor”, then select “compare”, and then select color. Click the color value, you can see the default value is “red”, marked as number #5 color. You can chose other color if you want. The EV3 color sensor can detect: black, blue, green yellow, red, white, brown and no color. Make sure your color sensor is plugged into port3, if not, you need to change the port value here. Next, drag and drop a “Move Steering” block to the canvas, and select “Off” to turn off the motors. To make it more interesting, let’s drag a “sound” block to the programming canvas, click the “File Name” box at the top right corner, click “Lego sound” files, then click “Colors” and then select “Red” from the color list. When you run this program, the robot will run until it finds the color “red”, then it stops and tell you “red”. Thanks for watching! Click “like” button and subscribe to our channel if you like the robotics videos , and if you have any suggestions please leave a comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *