-
Notifications
You must be signed in to change notification settings - Fork 21
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
Will this work for MCP23008 #6
Comments
|
MCP23008 is a single 8-bit port variant of the MCP23017. I don't have any MCP23008 chips/modules to test with, but I could fork this and rip out all of the 2nd port code if you're able to test it and confirm it all works. Sorry I missed this issue earlier. It's been a while. Are you still interested in the MCP23008? |
@mcauser I recently started a project with both a MCP23008 and a MCP23017. I was looking for a library for the MCP23008 but there's not much out there. I'd be very interested in helping you test this if you made a port for the MCP23008. |
Hi @plmetz , See https://github.com/mcauser/micropython-mcp23008 I haven't tested it on any hardware yet, or written up any documentation. import mcp23008
mcp = mcp23008.MCP23008(i2c, 0x20) List interface mcp[0].value()
...
mcp[7].value() Method interface mcp.pin(0)
...
mcp.pin(7) Property interface mcp.mode = 0xfe
mcp.gpio = 0x01 |
Thanks for pulling that library together. It works wonderfully, as far as I can tell. I am a hobbyist just getting started with electronics and python, so by no means an expert, but I did some testing, and on the MCP23008, I was able to:
If there is any other specific testing that you think would be warranted I'd be happy to try. What is your plan with the MCP23008 library? Leave it as a standalone or would you integrate it into this library? Or a "MCP230x" library? |
Hey, there's not a huge difference between them and the MCP23017 was well tested, so it should be good to go. There's a lot of overlap between the two libraries, so a common MCP230x may make sense down the track. I'll leave MCP23008 as is for now and add some readmes/docs to make it more complete. Then add a common ancestor to the backlog. |
I'm also able to submit some PRs for the documentation. As I work on my project with it I should also be able to get an example together. It's a busy time of year so might not be right away but I'd love to help. |
I wrote an example for the MCP23008 |
Unfortunately doesn't seem to work for MCP23008. Was able to create the mcp object but can't configure a pin for input or output.
The text was updated successfully, but these errors were encountered: