EasyManua.ls Logo

Waveshare Motor Driver HAT - BCM2835 Demo Code

Waveshare Motor Driver HAT
16 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Motor Driver HAT
11 / 16
DEV_Config.c(h): Defines PINS used and communication type, different between
BCM2835 and WiringPi.
PCA9685.c(h): Drive code of PCA9685 chip. Could output 16-channel PWM signal
via I2C interface
MotorDriver.c(.h): Drive code of TB6612FNG chip, control two motors.
main.c: main function
DEMO CODES
1. initialize BCM2835 libraries
if(DEV_ModuleInit())
exit(0);
2. Initialize motor and PCA9685
Motor_Init();
3. Control motors
Motor_Run(MOTORA, FORWARD, 100);
Parameter 1: MOTORA or MOTORB
Parameter 2: FORWARD or BACKWARD
Parameter 3: 0~100
If you use this module to control robot, with this function you can control the
whole motion of robot.

Related product manuals