Data Sheet
AlphaBot 2 User Manual     
10 
share awesome hardware
Quick start 
We have provided the control programs for Arduino and Raspberry Pi, which can 
implement many functions, such as tracking, obstacle avoidance, remote control, 
video monitoring and so on.   
You can get the example programs described in the following sections from the 
website of Waveshare Wiki. To apply these examples to your application, you need 
to copy the file  libraries under the directory of Arduino into the folder libraries 
under the installation directory of Arduino IDE. Then, restart the Ariduino IDE, and 
click File->  Example to see  if  there is  an  option  TRSensors. If yes,  it  means the 
libraries are imported successfully. When using the Raspberry Pi, you should extract 
the  example  programs  and  place  them  in  the  directory  of  /home/pi  under  the 
operation system of Raspbian. 
Arduino examples 
Motor testing 
Compile and download the program Run-Test. Normally, the smart robot moves 
forward when the program runs and drives the motor to rotate. In case that the 
direction of motion is wrong, you may need to modify the motor wring or change 
the pin settings in your program. We recommend the latter one. If left wheels of the 
robot run in a wrong direction, you should exchange the settings of AIN1 and AIN2. 
For right wheels, exchange the settings of BIN1 and BIN2. 
In the event that all the wheels run in a wrong direction, you should modify the 










