What is a PCA9685?
A pca9685 is a fairly widespread component allowing you to provide 16 additional PWM outputs which connects to I2C (GPIO 2 and 3 of your raspberry pi = SDA and SCL).
How to configure a PCA9685 on Vigibot?:
0) Connect your PCA to your raspberry pi on the I2C pins 2 and 3 (SDA and SCL)
1) Know the I2C address of your pca9685 (in decimal)
Method 1: read your card documentation
Method 2: run an I2C scan on your raspberry pi you will see all of the I2C peripherals present. (search for "raspberry pi i2cdetect")
=> Notice, often the I2C addresses are displayed in hexadecimal and not in decimal ...
In this case it will be necessary to convert the hexadecimal I2C address into decimal)
Example for a PCA9685 with the default I2C at 0x70, the decimal value is 112.
2) Add the address of Your PCA in your hardware configuration.
Go to Hardware Configuration, search for PCA9685ADDRESSES, and add your I2C address (in decimal!) Then save your configuration.
=> If you entered a valid I2C address, with a PCA connected your robot robot should still function as if nothing had changed.
=> If you have entered an invalid I2C address, or if your PCA is no longer connected, your robot will no longer be able to connect and will turn red on vigibot. (Removing the invalid address or correcting it with the valid address will correct the problem.
3) Configure the outputs you want to use with a PCA
In Hardware Configuration, modify the OUTPUTS that you want to use with the PCA9685 and in the "address" box replace -1 by 0 to assign it to the first PCA9685 whose address you have saved in PCA9685ADDRESSES.
In GPIOS, also check that the output numbers you want are between 0 and 15!
Save your configuration, if no configuration error normally your robot should work as desired and the output of your PCA be driven.
4) Bonus, connect several PCAs:
Add as many addresses as there are PCA9685 that you have in the PCA9685ADDRESSES table.
To select the PCA in OUTPUTS, change the -1 in address by 0 to select your first pca, by 1 to select the second 1 etc ...
Example of a card with PCA9685:
https://www.robot-ma...moteurs-32.html
- Mike118 aime ceci