Arduino uno R3

1.Preparation

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

Arduino接线图

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

Connect the arduino to the computer through the USB data cable, upload the program to the Arduino board, motor will start to rotate.

Open the serial port monitor of the Arduino IDE and set the baud rate of 9600. You can see that the serial port displays the positive and negative speed of the two motors, the input voltage value, and the current pwm speed regulation.