Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

PCA9685
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PCA9685

by ysap on Thu Jul 09, 2020 1:38 am

I'm new to Raspberry Pi so please excuse the possibly silly/basic question.
My question is specifically to a 16 channel PWM/Servo driver board (https://www.adafruit.com/product/815): does it take away all the Pi's input capability ? In other words, does it mean I only have the 16 channel PWM/Servo output capability, with no GPIO input capability ?
I see the manual (https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf) says "no input function", which seems self-explanatory, but then in another section it says "Active Low Output Enable (OE) input pin" so it seems like there is an input pin. Anyway, I need help please.
Thank you.

ysap
 
Posts: 4
Joined: Thu Jul 09, 2020 1:02 am

Re: PCA9685

by adafruit_support_bill on Thu Jul 09, 2020 5:24 am

does it take away all the Pi's input capability ?

Absolutely not. The PCA9685 just occupies one i2c address location on the i2c bus. All of the Pi GPIO pins remain fully functional.
I see the manual (https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf) says "no input function"

That is specifically in reference to the PWM output pins of the chip. They are output only, Their operation in no way affects pins on the Pi.
n another section it says "Active Low Output Enable (OE) input pin" so it seems like there is an input pin.

Actually, there are several input pins - including SDA, SCL, OE and all the address pins. Without any input pins it would be impossible for the Pi to send commands to the chip.

adafruit_support_bill
 
Posts: 78177
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685

by ysap on Thu Jul 09, 2020 9:38 am

Thank you very much for the answers.
Now it makes sense. on the PCA9685 layout, there is a row of pins, next to the 2x20 pins, that shows the SDA, SCL, and other GPIO pins available to solder.
And I just saw another board, a stepper hat, it also has that same row of pins containing SDA, SCL, and other GPIO pins available.
(choir sounds)
I guess this means full steam ahead on soldering. Looking back, I think I always had a suspicion about how that layout works, but my fear of soldering probably kept me looking the other way :)

ysap
 
Posts: 4
Joined: Thu Jul 09, 2020 1:02 am

Re: PCA9685

by ysap on Thu Jul 09, 2020 5:56 pm

I can't seem to setup servo using the ServoKit import. The adafruit servo hat instructions mention the following commands:

from adafruit_servokit import ServoKit

I use Thonny and when the .py file reads that command line, it gave the error message: ImportError: cannot import name 'Servokit' from 'adafruit_servokit' (/usr/local/lib/python3.7/dist-packages/adafruit_servokit.py)

Troubleshooting steps:
- I have verified that the /usr/local/lib/python3.7/dist-packages/adafruit_servokit.py file exists in that directory.
- adafruit_blinka is installed.
- Thonny is able to control LED brightness using pwm with this particular PCA9685 hat.
- sudo pip3 install adafruit-circuitpython-servokit ran fine in shell.
- I couldn't find anything helpful from google regarding this error.

Could anyone help please ?

Much appreciated.

ysap
 
Posts: 4
Joined: Thu Jul 09, 2020 1:02 am

Re: PCA9685

by adafruit_support_carter on Mon Jul 20, 2020 12:22 pm

ImportError: cannot import name 'Servokit' from 'adafruit_servokit' (/usr/local/lib/python3.7/dist-packages/adafruit_servokit.py)


In your code, make sure the 'k' is capitalized in ServoKit. Like this:
Code: Select all | TOGGLE FULL SIZE
from adafruit_servokit import ServoKit

adafruit_support_carter
 
Posts: 16268
Joined: Tue Nov 29, 2016 2:45 pm

Re: PCA9685

by ysap on Tue Jul 21, 2020 9:18 pm

That fixed it. My bad. Thank you sooo much !

ysap
 
Posts: 4
Joined: Thu Jul 09, 2020 1:02 am

Please be positive and constructive with your questions and comments.