Skip to content

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

Merged
hsalameh merged 2 commits into
zugaldia:masterfrom
RacZo:master
Jul 13, 2017
Merged

Refactored AdafruitMotorHat and AdafruitPwm constructors to allow stacking of other hats#45
hsalameh merged 2 commits into
zugaldia:masterfrom
RacZo:master

Conversation

@RacZo
Copy link
Copy Markdown
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.

RacZo added 2 commits July 13, 2017 00:08
…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
Copy Markdown
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!

@zugaldia zugaldia requested review from hsalameh and zugaldia July 13, 2017 18:46
Copy link
Copy Markdown
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
Copy Markdown

@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