ROLLBOTMICRO
20
5.2 Motor Testing
This experiment is to test whether the motor wiring is right or not. There can be 4 situations: the
wiring of both motors is normal; both motors are wired inversely; the left one is normal but the
right one is wired inversely; and the right one is good while the left one is wired inversely. We will
introduce how to distinguish the cases then.
First, find
MotorTest.ino
under
RollbotMicro\Arduino Code\MotorTest
and upload to the
RollbotMicro and observe the robot.
NOTE:
Please remember
Speed_Dir
since it will be useful in the programs related to the motors
later.
1)
If the robot goes forward, it indicates all motors are wired normally. There is no need to modify
the value of the variable
Speed_Dir
in the program since it’s
0
by default.
2)
If the robot goes backward, it means that both motors are wired inversely. You need to
change the variable value 0 of
Speed_Dir
into
1
to run the program normally.
3)
If the robot rotates clockwise (always towards its right side), it indicates the left motor is wired
normally while the right one is done reversely. You need to change the value 0 of
Speed_Dir
into
2
.
4)
If the robot spins anti-clockwise (always towards its left side), it indicates the right motor is
wired normally while the left one is reverse. Change the value 0 of
Speed_Dir
to
3
.
5.3
Line Following
This experiment is to let the robot goes forward along the black line. OLED displays the signal
strength that 1, 5 sensor received. When the robot turns left, the yellow LED on the left lights. The
yellow LED on the right lights when the robot turns right. No LED lights when the robot goes
straight.
Left Motor
Right Motor
SunFounder