adafruit / Adafruit_CircuitPython_Bundle

A bundle of useful CircuitPython libraries ready to use from the filesystem.
MIT License
876 stars 189 forks source link

Default 12c addresses for pca9685.py and motor.py are different. #20

Closed notthatbrad closed 6 years ago

notthatbrad commented 7 years ago

Not sure if this is an issue, or just an oddity. the default address of the pca9685 breakout is 0x40. This is reflected in pca9685.py. The learning system documents also show that is the default for the featherwing (https://learn.adafruit.com/adafruit-8-channel-pwm-or-servo-featherwing/pinouts).

In motor.py the code is trying to set up the motors up on 0x60. This was throwing an error for me until JerryN showed me how to override that to 0x40. I'm not sure if this is a bug or just something I'm looking at wrong, but thought I would mention it just in case.

mrmcwethy commented 7 years ago

The adafruit_pca9685.motor.DCMotor class AND adafruit_pca9685stepper.Steppers() both show 0x60 as the default address. I think they both should be 0x40 since the Adafruit board has a default address of 0x40.

If you agree i can make this change.

tannewt commented 7 years ago

Thanks for finding this @notthatbrad and @mrmcwethy! Would either of you be willing to submit a pull request to fix it?

notthatbrad commented 7 years ago

I'm pretty new to github, so not sure if I would be the best to do that, but I'll be happy to do anything I can. I can say that updating the motor.py file locally to 0x40 on my pc has corrected the error.

@mrmcwethy it failed looking for one on 0x40? Did you have a PCA9685 connected?

mrmcwethy commented 7 years ago

@notthatbrad I don't have that board, so I did expect to get that error. It just means i didn't make a big mistake and add syntax errors and i proved that the default address is now 0x40. I am going to release my changes.

notthatbrad commented 7 years ago

Groovy, that's why I was wondering. I had accidentally hooked mine up backwards earlier, and I got the error as well on code that I knew should be working.

Let me know when the changes are made, and I'll download the new version to test as soon as I can.

tannewt commented 7 years ago

Fixed in the driver commit: https://github.com/adafruit/Adafruit_CircuitPython_PCA9685/commit/c227c10f5424fb5d6859efb7aefcb72b4ff69305

I'll leave this open until we release a new version.

tannewt commented 6 years ago

FYI, 0x60 makes sense for motors and stepper motors because its the default address of the motor featherwing. The servowing is 0x40 by default. I'm fixing this up with my rework of the PCA9685 drivers.

notthatbrad commented 6 years ago

So it is (I just got the motor featherwing, and am testing it now)....but if I recall correctly, when using the PCA9685 breakout, the address is is 0x40, and the learn site has the featherwing documented as 0x40. https://learn.adafruit.com/adafruit-8-channel-pwm-or-servo-featherwing/pinouts

This could be really confusing for people looking for the driver for the PCA9685 breakout

tannewt commented 6 years ago

Yup, I'll be refining it shortly.

On Thu, Dec 28, 2017 at 9:49 AM Brad T notifications@github.com wrote:

So it is (I just got the motor featherwing, and am testing it now)....but if I recall correctly, when using the PCA9685 breakout, the address is is 0x40, and the learn site has the featherwing documented as 0x40.

https://learn.adafruit.com/adafruit-8-channel-pwm-or-servo-featherwing/pinouts

This could be really confusing for people looking for the driver for the PCA9685 breakout

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_CircuitPython_Bundle/issues/20#issuecomment-354327469, or mute the thread https://github.com/notifications/unsubscribe-auth/AADNqZe3AFKsni0Je2JGuOaxKzi5Gxhrks5tE9S0gaJpZM4Ph6CO .