Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored AdafruitMotorHat and AdafruitPwm constructors to allow stacking of other hats #45

Merged
merged 2 commits into from
Jul 13, 2017

Conversation

RacZo
Copy link
Collaborator

@RacZo RacZo commented Jul 13, 2017

Refactored constructor methods of AdafruitPwm and AdafruitMotorHat classes so they can receive the i2c device name and i2c slave device address instead of having them hardcoded.

With the changes I'm commiting and a new driver I've written (inspired by Antonio's Motor Hat driver), I was able to stack the Adafruit 16-Channel PWM Servo Hat that I'm using to control the pan/tilt bracket's servos my camera module is mounted on, on top of the Adafruit DC and Stepper Motor HAT.

…or methods to allow then to receive the i2c device name and i2c slave device address

The change allows me to stack other hats and address them correctly via i2c
@zugaldia
Copy link
Owner

@RacZo This is great, particularly now that we're working on #40 (though I haven't been able to make it work yet). I'll review it soon!

Copy link
Collaborator

@hsalameh hsalameh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the diff showing so many changes in some code that has not really changed?

@hsalameh hsalameh merged commit 53a3a7a into zugaldia:master Jul 13, 2017
@alexmcroberts
Copy link

@hsalameh it's white space changes – if you append "?w=1" to the files URL, e.g. https://github.com/zugaldia/android-robocar/pull/45/files?w=1 you'll see that the number of lines decreases by 300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants