May 2018
Intermediate to advanced
340 pages
7h 20m
English
In the previous chapter we have seen that we are making the car turn in any of the directions just based on our hand movements, however there is a problem with the previous code. Firstly the car is moving in one direction at a time, that is it's going either forward or backward or turning left or right.
It was not able to make a banking turn based on the hand gestures itself. To make it capable of doing so, we need to make the code even smarter. The overall connections to the robot would be exactly the same. But the code would be slightly different, so let's see what it is:
import smbusfrom time import sleepimport RPi.GPIO as GPIOint1 = 12int2 = 16int3 = 18int4 = 15GPIO.setup(int1, GPIO.OUT)GPIO.setup(int2, GPIO.OUT) ...