# Help Interpreting Raspberry Pi GPIO's allocated to Robot starter kit called AlphaBot2

I am a complete newbie to robotics, so please excuse me if this is a simple question. I bought this robot starter kit and need help understanding which features are associated to which GPIO pins:

Here are the schematics: Schematics

Is this information sufficient for me to know what feature is mapped to the GPIO pins or do I have to follow some type of trial and error process to figure it out? Your help would be greatly appreciated.

Waveshare maintain a wiki page for the Alphabot2.

In the resources section on that page, there are some links to demo code which contains definitions for the allocation of GPIO pins.

It looks like the specific file you want is AlphaBot2-Demo.7z

The compressed file contains a folder named Python:

I've taken the mappings below from these files. Note that this list of GPIO mappings may not be exhaustive as I haven't fully followed through on checking file dependencies etc.

Note also that the pin assignments used in the code use Broadcom GPIO numbers (BCM). These are the GPIOxx numbers on the diagram below, not the actual pin numbers on the header:

AlphaBot2.py appears to control the robot's motors. The pin assignments are:

ain1=12
ain2=13
ena=6
bin1=20
bin2=21
enb=26


Ultrasonic_Obstacle_Avoidance.py and Ultrasonic_Ranging.py specify:

TRIG = 22
ECHO = 27


Which are obviously the pins allocated to your ultrasonic sensor

Similarly, Infrared_Obstacle_Avoidance.py specifies

DR = 16
DL = 19


which are the pins used by the IR sensor

TRSensors.py specifies:

CS = 5
Clock = 25
DataOut = 23
Button = 7


IRremote.py sets

IR = 17


Joystick.py assigns the following pins:

CTR = 7
A = 8
B = 9
C = 10
D = 11
BUZ = 4


Line_Follow.py also sets GPIO7:

Button = 7


Finally, ws2812.py sets the LED pin to 18

LED_PIN = 18  # GPIO pin connected to the pixels (must support PWM!).

• Thank you so much for your detailed response. – c0D3l0g1c Feb 23 '19 at 1:51