If you're following along with a Raspberry Pi, Beaglebone or any other supported small linux computer, we'll use a special library called adafruit_blinka (named after Blinka, the CircuitPython mascot) to provide the layer that translates the CircuitPython hardware API to whatever library the Linux board provides. It's CircuitPython, on Pi!
If you haven't set up Blinka and the Adafruit IO Python Library yet on your Raspberry Pi, follow our guide:
Enable I2C
We use two pins on the Pi (SDA/SCL) to communicate over I2c with the PCA9685. You only have to do this step once per Raspberry Pi, the I2C interface is disabled by default.
Once you're done with this and have rebooted, verify you have the SPI devices with the command:
sudo i2cdetect -y 1
If your PCA9685 Breakout is wired up correctly, it'll show up at 0x40:
Installing the CircuitPython-PCA9685 Library
You'll also need to install a library to communicate with the PWM breakout. Since we're using Adafruit Blinka (CircuitPython), we can install CircuitPython libraries straight to our Raspberry Pi. In this case, we're going to install the CircuitPython-PCA9685 library.
Run the following command to install the CircuitPython-PCA9685 library:
pip3 install adafruit-circuitpython-PCA9685
Text editor powered by tinymce.