Download Print this page

Arduino Mega2560 Manual page 21

Mars explorer mecanum wheel robotic kit

Advertisement

Step 4: Choose corresponding board/port for your project, upload the sketch to the board.
Step 5:Ultrasonic sensor servo initial direction alignment
After turning on the battery, the servo will make some movement and finally stops at a
direction for 5 seconds. During this first 5 seconds, you must make sure the Ultrasonic
sensor(two eyes) is facing straight forward.
If it is not straight forward, you should turn off battery immediately and remove the
sensor from servo, reinstall it and make it facing straight forward direction as
following picture.
Otherwise the obstacle avoidance program will not work properly. After adjusting sensor
direction, turn on battery again. If its direction is not straight forward, turn off
battery and do direction alignment again.
If the ultrasonic module turn to front view position, that means you no need adjust
sensor position anymore. Just wait 5 seconds. If no obstacle is detected, the car will go
forward. If any obstacles is detected, the car will stop, the ultrasonic module will turn
from right to left to detect surrounding obstacle.
The robot car will decide to make left turn, right turn or backward according to obstacle
sensor data and our obstacle avoidance algorithm. Sometimes your car might have collision

Hide quick links:

Advertisement

loading
Need help?

Need help?

Do you have a question about the Mega2560 and is the answer not in the manual?

Subscribe to Our Youtube Channel