There are glitches and strange behavior that you can avoid when you follow these rules.

Необходимо е да се абонирате за FLLCasts.com, за да достъпите това видео
- #841
- 20 Apr 2018
Avoid giving motor start commands in loop
Do not give several start commands one after the other. Do not put forward.start() in a loop without forward.stop(). The motor is not going to keep moving, but rather is going to change its speed randomly.
Start with a stop command
Another glitch that we found is that the first start command to a motor is not going to be executed well. The second start command moves the motor in full speed. So we added explicit stop right after the initialization of the GPIO ports:
#Define PWM functions forward = GPIO.PWM(forwardPin, frequency) backward = GPIO.PWM(backwardPin, frequency) left = GPIO.PWM(leftPin, frequency) right = GPIO.PWM(rightPin, frequency) # initialize in stopped position. Helps to avoid problems forward.stop() backward.stop() left.stop() right.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 motors from the computer
Before you start your car, make sure that everything runs as you expect. We will do that by putting the car on a stand so that when we start to motors, the car is not moving.
- 3
- 0
- 1
- 3d_rotation 0