RaspberryPi

1. Preparation

Connect the motor drive board and Raspberry Pi according to the wiring diagram, connect the battery to the power input interface on motor drive module.

树莓派接线图

树莓派接线图

Note: The motor interface wire sequence of the dual motor drive board should correspond to the motor pin! Otherwise, the motor drive plate will be damaged.

Note: The motor interface wire sequence of the dual motor drive board.

image-20230215160150782

 

2. Code

 

3. Experimental result

Run the program, the motor drive board drives the two-way motor to rotate for 5s, and the terminal prints the speed of the motor.