Line follower code nxt robot source code
Find a suitable video online to demonstrate an example of this to the students. Once the wheeled robot is following the line, can it be improved to behave more like a car i. Note Students will once again use the Color Sensor, but this time they will need to program it so that it responds to reflected light intensity. They will need to take reflected light intensity readings from the Port View in order to gauge what value to input into the Wait Block.
This will work best using black or blue tape on a very light or white surface. You will need to spend some time explaining the concept of a switch and how it is an example of Boolean logic.
A possible extension from here would be to add a second Color Sensor, and combine the line-follow and traffic light programs to simulate automated passenger services, such as a train system in an airport. Share Allow the students to select the tool s they find most appropriate for capturing and sharing their creations, unique thinking, and learning process. This lesson has covered a lot of new concepts and introduced several new blocks from the EV3 Software.
Use this time to recap this information and ensure that the students understand it. Ask one or two groups to demonstrate their programs. Ask the students to share what they expected to happen vs. Ask them whether anything about the results of their programs surprised them. Assessment Opportunity Specific rubrics for assessing computational thinking skills can be found under 'Assessment'.
Using text-based Programming Have the students explore text-based programming solutions so they can compare different programming languages. Guide to reinstalling EV3 Brick.
Products Files Page Downloads Lessons. You have no items in your basket. Explore more at LEGOeducation. View online Download pdf. Ignite a classroom discussion around the following questions: Can autonomous cars react to different traffic light signals? What can happen if a driver falls asleep while driving? How can we detect when a driver is falling asleep? Have the students perform the following building check before they program their robots: Are the wheels rotating freely?
Are the wires correctly connected from the Color Sensor to port 3? Start motors B and C drive forward. Wait for the Color Sensor to detect the color red. Wait for the Color Sensor to detect the color green. Repeat steps 2 to 5 forever. Start motors B and C drive forward with a curve toward the line.
Wait for the Color Sensor to detect the color black, then start tasks 1 and 2. Wait for the Color Sensor to detect the color black. The robot then stops. The maximum quantity of an item that can purchased in each transaction is In this way, the robot follows the line. The approach is very simple and effective. However, as the robot only distingushes between black and white, the resulting movement looks as if it would be drunk.
The idea behind the new version is, not only to distinguish between black and white, but to consider various degrees of grey. If the sensor is exactly on the boundary, it will see a colour that is between black and white.
The more the sensor gets on the line, the blacker the perceived colour is. On the other hand, the more the sensor gets on the white surface, the whiter the perceived colour is.
This is called Fuzzy Logic as we do not consider absolute states Boolean Logic, here "Black and White" but different degrees of those states Whiter, Blacker.
Now we are not limited anymore to turn only left and right, but can turn more right blacker colour or more left whiter colour. In this way, if exactly on the colour boundary, the robot runs straight ahead. The program consists of three loops that run at the same time.