A proposed outline for a three session "Taste of Tech" course with EV3 (Mindstorms) LEGO robots.
This session challenges the students to develop a simple line following behavior for their robot. The task is accomplished using the color sensor to detect the present of a line edge and update it’s course based on its sensor’s feedback. Students will use the programming skills they’ve required through the previous exercises. A full walk through of the code is below in the Behavior section.
The robot follows a dark (continuous) line around using the color sensor to detect the edge if the line and a switch block to steer the robot. The program executes the following steps.
Note: The example program is written so that the robot will follow the inside edge of a line (if the line is a tracing a circle). If you’d prefer your robot to follow the outside edge swap the position of the motor blocks so that the robot goes left when reflectivity is high and right when reflectivity is low.