adafruit / Adafruit-PWM-Servo-Driver-Library

Adafruit PWM Servo Driver Library
Other
477 stars 311 forks source link

passing I2C address when creating Adafruit_PWMServoDriver resets Arduino #58

Closed smarthusker closed 5 years ago

smarthusker commented 5 years ago
smarthusker commented 5 years ago

If Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40, &Wire); is used, the code executes as expected.

ladyada commented 5 years ago

@smarthusker if you use the master branch from github instead of v1.0.4 does that help

smarthusker commented 5 years ago

I did grab the latest .cpp and .h files that were updated 3days ago without any difference in behavior.

Sent from my iPhone. Please excuse brevity and typos.

On Jul 27, 2019, at 3:51 PM, ladyada notifications@github.com<mailto:notifications@github.com> wrote:

@smarthuskerhttps://github.com/smarthusker if you use the master branch from github instead of v1.0.4 does that help

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/issues/58?email_source=notifications&email_token=AHXG6FXXYKBCCSN6J566MTTQBS7PLA5CNFSM4IHKFM32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26THXY#issuecomment-515716063, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHXG6FTGGZ4CGGCKA75G42TQBS7PLANCNFSM4IHKFM3Q.

hoffmannjan commented 5 years ago

tested it today with feather PCA9685 and esp32 - all works fine. edited all the examples - PR #59

ladyada commented 5 years ago

ok merged, @smarthusker plz try master branch again :)

sticilface commented 5 years ago

Same issue as: https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/issues/50

I still feel that passing in the Wire as a pointer is pointless and unsafe. using a reference would be much safer and completely prevent errors such as these where the i2c address is being used as a pointer.

ladyada commented 5 years ago

@sticilface wanna submit a PR and we'll try it out?

ladyada commented 5 years ago

we believe this is fixed by @Bolukan 's awesome PR please try v2.1.0 when it appears in your library manager, and re-open if still an issue!