User Manual

41
bw.set_speed(forward_speed)
Here we need two functions for rear wheels. The first function is to control the rotating direction
as forward (the function for backwards is bw.backward()). The second one is to set the rotating
speed of the wheels; the parameter is the speed value (range: 0-100). The bigger the
parameter is, the faster the wheel rotates.
Line Following
How to Follow Lines
The line follower detects lines in the surrounding environment, and transfers the data to the
processor. The processor analyzes the data, and sends a command to control the movement of
front wheels and rear wheels.
Principle
The TCRT5000 IR sensor on the line follower has a TX and RX inside. If a bright color surface is
detected in front of the sensor, such as a white paper (about 1cm away), most of the IR rays will
be reflected; if a dark color like black surface is detected, most of the rays will be absorbed, while
only a small amount will be reflected. The RX will output different analog signals according to the
intensity of the reflected IR light.
The ADC chip on the HATS can receive analog signal and convert it into digital signal, and transfer
to the Raspberry Pi.
Procedures
Step 1 Assembly
Connect the light follower to the Sensor Connector with M3*10 screws and M3 nuts, and then
assemble them to the car with two M3*10 screws and two M3 nuts. You're suggested to hold
the nuts underneath with your fingers.