The document provides instructions for creating a line follower program using the EV3 that will follow a line until it detects a specific color and then stop. It includes steps to create a simple line follower, modify the loop exit condition, make a My Block with inputs, and wire the My Block.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
55 views11 pages
Color Follower Sensor
The document provides instructions for creating a line follower program using the EV3 that will follow a line until it detects a specific color and then stop. It includes steps to create a simple line follower, modify the loop exit condition, make a My Block with inputs, and wire the My Block.
Lesson Objectives 1. Learn how to write a line follower that takes multiple inputs 2. Learn how to write a line follower that stops when it sees a another line 3. Practice making useful My Blocks
Prerequisites: My Blocks with Inputs & Outputs, Data Wires
The code uses Blue Comment Blocks. Make sure you are running the most recent version of the EV3 Software. EV3Lessons has Quick Guides to help you.
Tips to Succeed 1. You will need to know how to make a Simple Color Line Follower program and how to make a My Block with inputs 2. Since you will use your EV3 Color Sensor in Color Mode, you will not have to Calibrate your color sensor for this lesson 3. Check which ports you have your color sensor connected to the EV3 and adjust the code as needed 4. You may have to adjust the speed or direction to work for your robot. Make sure that the the color sensor is in front of the wheels in the direction of travel. 5. Make sure you place the robot on the side of the line that you are following. The most common mistake is placing the robot on the wrong side of the line to begin with.
Color Follower Until Color Challenge: Create a line follower My Block that stops when it sees black STEP 1: • Create a simple line follower STEP 2: • Change the loop exit condition to “until black” STEP 3: • A. Make a My Block with 3 inputs: Power, Color to line follow on, and Color to stop at • B. Wire the My Block
Step 3B: The My Block • Now the My Block appears in the turquoise tab and the same My Block can be used again and again with new inputs (see left) • The first block solves the challenge and follows a red line until it sees the robot sees black • The second block in this code is to show that the same block can be used with different inputs • If you want to learn smoother line followers, proceed to the proportional control lesson in Advanced.
Next Steps • We use a simple line follower in this lesson. You can combine these techniques with any line follower. • Learn how to create a proportional line follower for light or a smooth line follower for color à check out our Advanced: Proportional Line Follower lesson.
IBM Watson Solutions for Machine Learning: Achieving Successful Results Across Computer Vision, Natural Language Processing and AI Projects Using Watson Cognitive Tools (English Edition)