Motor And Servo Driver HAT is an module of DC motor and servo driver specially designed for Raspberry Pi. This module can drive 2 channels of DC motors and 6 channels of servos at the same time. It can make the desired function come true only through the I2C protocol control register
Supply Voltage:6V~12V(VIN terminal or pin)
Logic Voltage:3.3V
PWM Driver Chip:PCA9685
Interface Protocol:I2C
Motor Driver Chip:TB6612FNG
Motor And Servo Driver HAT has designed a separate power switch. After power on, the POWER needs to be turned to the ON position. In addition, all the address lines of I2C are led out, and the address can be set by means of the DIP switch. The demo codes we provide are set the address to 0X7F, and the DIP switch settings are as follows:
Hardware Connection :Switch
A0 -> OFF A1 -> OFF
A2 -> OFF A3 -> OFF
A4 -> OFF A5 -> OFF
wiringpi Libraries Installation:
sudo apt-get install wiringpi
wget https://project-downloads.drogon.net/wiringpi-latest.deb # Raspberry Pi 4B version upgrade
sudo dpkg -i wiringpi-latest.deb
gpio -v # If version 2.52 appears, it means that the installation has been successful
1、I2C Configuration of Raspberry Pi
Start the system configuration of Raspberry Pi:
sudo raspi-config
Enable I2C Interface:
Interfacing Options -> I2C -> Yes
sudo reboot
Check the enabled I2C devices:
ls /dev/i2c* # at this time it will print:“/dev/i2c-1”
Install the I2C libraries:
sudo apt install i2c-tools
Install python's smbus:
sudo apt install python-smbus
Test the device address mounted on the I2C bus:
sudo i2cdetect -y -a 1
2、Execute the demo codes
Python:
Access the directory of python:
cd /home/pi/Motor And Servo Driver HAT/raspberry pi/python
Execute:
sudo python3 pca9685.py
C:
Access the directory of C:
cd /home/pi/Motor And Servo Driver HAT/raspberry pi/c
Execute:
make clean
make
sudo ./main
Thank you for choosing the products of Shengui Technology Co.,Ltd. For more details about this product, please visit: www.seengreat.com