-
Notifications
You must be signed in to change notification settings - Fork 7
Updating for MCP4728A4 #13
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
Conversation
Updating library to be able to pass 0x64 I2C address for MCP4728A4 variant
👋 Thanks for this pull request! Unfortunately, it looks like the automated continuous integration (CI) test(s) failed. These can be tricky to fix so we've written a guide on how to fix them locally. It has pages about running pre-commit locally and another about building the docs locally with sphinx. Thanks for contributing to CircuitPython! If you have more questions, feel free to join the Adafruit Discord and post in #circuitpython-dev. |
Updating for CI
Did the CI add all those extra lines in the example file? If possible, it may be more legible to keep it as it was. For the library, thanks for the type annotation! Perhaps it might be nice to add the different I2C addresses as public global variables at the top: MCP4728_DEFAULT_ADDRESS = 0x60
MCP4728A4_DEFAULT_ADDRESS = 0x64 Then we can additionally encourage people to use them as/if needed: i2c = board.I2C()
mcp4728 = MCP4728(i2c, address=MCP4728A4_DEFAULT_ADDRESS) What do you think, would that be helpful? |
Thanks! It totally did add all those lines so I just removed those. This is my first time contributing to a library so I appreciate the feedback! I think global variables would definitely be helpful and I could point them out in the Learn guide. You're saying these variables would be in the example files? |
If you change import board
import adafruit_mcp4728
i2c = board.I2C() # uses board.SCL and board.SDA
# Use the default address for the MCP4728A4 variant of the board
mcp4728 = adafruit_mcp4728.MCP4728(i2c, address=adafruit_mcp4728.MCP4728A4_DEFAULT_ADDRESS)
... Just make those changes and push the fix for the extra spaces and it should be good to go! |
Updating both variants of the board as public global variables and adding an example in the main example file. Also fixing spacing from original local pre-commit run
got it, yeah i definitely like that. just PR'd that update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, nice!
Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP4728 to 1.3.0 from 1.2.5: > Merge pull request adafruit/Adafruit_CircuitPython_MCP4728#13 from adafruit/MCP4728A4_update > Added Black formatting badge > Changed .env to .venv in README.rst Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC to 1.0.9 from 1.0.8: > Merge pull request adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC#5 from NanoExplorer/struct_features > Changed .env to .venv in README.rst
Updating library to be able to pass 0x64 I2C address for MCP4728A4 variant (see revision history on product copy: https://www.adafruit.com/product/4470).