Stop the robot after the third line: Difference between revisions

From wikiluntti
No edit summary
No edit summary
Line 21: Line 21:


==== Readings of the color sensor ====
==== Readings of the color sensor ====
[[File:StopAt3rdLineSensor.png|thumb]]


==== Using the timer ====
==== Using the timer ====

Revision as of 22:40, 5 September 2020

Introduction

How to stop the robot after passing the third (or nth) line? This problem is very often encountered in FIRST Lego League (FLL) or in Rescue competitions. The problem is that the sensor reads continous data, and simple solution wont work.

This page gives to different solutions: (i) using timer to pass the lines and (ii) using flip-flop algorithm to count the black lines.


Robot

Almost any robot will do. We use Asimov 2/ Verne robot.

Sensors

One color sensor is needed.

Example Videos

Theory

Readings of the color sensor


Using the timer

Using flip flop circuit

Example Code

Using the timer

Using flip flop circuit

Exercises

This course is supported by Meet and Code. The course is made in collaboration with Robotiikka- ja tiedekasvatus ry.

Back to Meet and Code 2020 I: Ev3-G front page