Waiting for translation from Bulgarian.

To access the full video please subscribe to FLLCasts.com
- #1636
- 02 Jul 2020
# Create your objects here. ev3 = EV3Brick() right_touch = TouchSensor(Port.S2) left_touch = TouchSensor(Port.S1) right_motor = Motor(Port.C) left_motor = Motor(Port.B) right_speed = 1000 left_speed = 1000 right_flag = Flase left_flag = False # Write your program here. ev3.speaker.beep() while True: if right_touch.pressed(): right_motor.run(right_speed) right_flag = True else: right_motor.brake() if right_flag: right_speed = right_speed * (-1) right_flag = False if left_touch.pressed(): left_motor.run(left_speed) left_flag = True else: left_motor.brake() if left_flag: left_speed = left_speed * (-1) left_flag = False
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