-1

I am running Ubuntu 22.04LTS in order to use ROS-humble on my RPi, however I am running into some issues. How do I configure the GPIO pins and also is there some things that I should note. I plan on using PCA9685 with is a pwm expansion which uses i2c to communicate.

I used this resource so far https://ubuntu.com/tutorials/gpio-on-raspberry-pi#1-overview

but I am not sure if this would solve my issue. I really just need someone to tell/show me a good example on how to set this up.

Essentially, all I want is to configure my GPIO pins. Is there anything I need to do prior ie install libraries? Or should I be good to go from the get go. I am only asking this because I always run in to package issues when trying to program the PCA9685.

3
  • Have you enabled I2C interface?
    – liaifat85
    Commented Jun 13 at 14:00
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Jun 13 at 17:04
  • @liaifat85 yes, I have.
    – msalaz03
    Commented Jun 13 at 23:45

2 Answers 2

0

You shouldn't need ANY library. Just use dtoverlay i2c-pwm-pca9685a in config.txt

Name:   i2c-pwm-pca9685a

Info:   Adds support for an NXP PCA9685A I2C PWM controller on i2c_arm

Usage:  dtoverlay=i2c-pwm-pca9685a,<param>=<val>

Params: addr                    I2C address of PCA9685A (default 0x40)
        i2c0                    Choose the I2C0 bus on GPIOs 0&1
        i2c_csi_dsi             Choose the I2C0 bus on GPIOs 44&45
        i2c3                    Choose the I2C3 bus (configure with the i2c3
                                overlay - BCM2711 only)
        i2c4                    Choose the I2C3 bus (configure with the i2c3
                                overlay - BCM2711 only)
        i2c5                    Choose the I2C5 bus (configure with the i2c4
                                overlay - BCM2711 only)
        i2c6                    Choose the I2C6 bus (configure with the i2c6
                                overlay - BCM2711 only)
2
  • Yeah I ran "sudo i2cdetect -y 1" and I can see the pca-9685 on the correct address so I know it can see it. what would this command be doing essentially?
    – msalaz03
    Commented Jun 10 at 23:12
  • I don't have one so can't say but presumably this will add /dev entries you could use to access. WHAT do you see?
    – Milliways
    Commented Jun 12 at 7:25
0

Sorry for the confusing question, but to answer my own question I was missing the RPi.GPIO dependency which I was able to get through this cmd: sudo apt-get install python3-rpi.gpio

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.