Do not create empty loops with pass keyword.

Необходимо е да се абонирате за FLLCasts.com, за да достъпите това видео
- #846
- 20 Apr 2018
Often in your programs you will wait for sensor to continue your program.
Do NOT do this:
# wait obstacle move.forward() while sensor.distance > 0.50: pass #eof wait < 50cm move.stop()
Rather give the CPU time to multi-task.
# wait obstacle move.forward() while sensor.distance > 0.50: sleep(0.1) # required for smooth work, let the CPU multi-task #eof wait < 50cm move.stop()
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.

Perfect STEM course. Module 1 - Smart Car with Raspberry PI
Disassemble a remote control car. Change the brain of the car with a smart computer like Raspberry Pi. Build a smart device with artificial intelligence that you could control from your phone and that could freely navigate itself in the real world and on the Internet. Use your hands. Develop programs for your robot and your phone. Be curious and invent.
The perfect course lives up to its name. You move through the content, we check it and return feedback to you.
In the end, you should be able to better understand how to program and design smart devices that would make the world a better place. For everybody age 12+, 16+, 21+, 35+, etc. The hardware costs about 150$. It changes through the years so it might take some time for you to find it as Raspberry PI, motor drivers, power banks and h-bridges.. they change. Note that the course was designed to be led by a teacher with a decent knowledge in embedded hardware and software. This, on the other hand should not stop you, if you are curious.
- 118
- 42:47
- 136

Execute Python program about car distance sensor from the computer
This is going to be one complex connection with four pins and three resistors, so brace yourselves!
- 3
- 0
- 1
- 3d_rotation 0