
To access the full video please subscribe to FLLCasts.com
- #1622
- 25 Jun 2020
Example solution to the tasks in section "Drive":
# Create your objects here. ev3 = EV3Brick() left_touch = TouchSensor(Port.S1) right_touch = TouchSensor(Port.S2) left_motor = Motor(Port.B) right_motor = Motor(Port.C) # Write your program here. ev3.speaker.beep() while not left_touch.pressed(): pass while left_touch.pressed(): pass while not right_touch.pressed(): pass while right_touch.pressed(): pass left_motor.run(100) right_motor.run(100) wait(2000)
Example solution to the tasks in section "Acceleration":
# Create your objects here. ev3 = EV3Brick() left_touch = TouchSensor(Port.S1) right_touch = TouchSensor(Port.S2) left_motor = Motor(Port.B) right_motor = Motor(Port.C) speed = 100 # Write your program here. ev3.speaker.beep() while True: while not left_touch.pressed(): pass while left_touch.pressed(): pass while not right_touch.pressed(): pass while right_touch.pressed(): pass speed = speed + 50 left_motor.run(speed) right_motor.run(speed)
Example solution to the tasks in section "Deceleration":
# Create your objects here. ev3 = EV3Brick() left_touch = TouchSensor(Port.S1) right_touch = TouchSensor(Port.S2) left_motor = Motor(Port.B) right_motor = Motor(Port.C) speed = 100 # Write your program here. ev3.speaker.beep() while True: while not left_touch.pressed(): wait(200) speed = speed - 5 left_motor.run(speed) right_motor.run(speed) while left_touch.pressed(): wait(200) speed = speed - 5 left_motor.run(speed) right_motor.run(speed) while not right_touch.pressed(): wait(200) speed = speed - 5 left_motor.run(speed) right_motor.run(speed) while right_touch.pressed(): wait(200) speed = speed - 5 left_motor.run(speed) right_motor.run(speed) speed = speed + 50
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

Python with LEGO Mindstorms EV3 - Level 2
In the second level of Python for EV3 robots, students learn in-depth the touch sensor. The sensor is used as an input device for manual control of machines, as well as a sensor for autonomous robots. In a pair of lessons, students build a control panel for the grabber and the movement of a crane. Programming wise, students learn how to fork code with "if-else" constructions, how to create conditional and forever loops with "while" and how to negate conditions with "not" operator. In the end of the lesson, robots can detect obstacles and avoid them, so that they traverse a simple labyrinth.
- 39
- 19:58
- 93

Lesson 5 - Railroad Handcar
Remember to provide feedback to students regularly. It's important to give structured feedback in the form of a grade. Today, you'll need to grade your students following this article.
- 4
- 7
- 3
- 3d_rotation 1