ShrimpingIt / micropython-mcp230xx

Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx
GNU Affero General Public License v3.0
30 stars 16 forks source link

Pyboard compatibility #1

Open stlehmann opened 6 years ago

stlehmann commented 6 years ago

Thanks for this great mcp230xx library. This makes the handling of my MCP23017 much smoother. However I had to make some adjustments to make it work on my pyboard v1.1. On the pyboard the I2C class of the pyb package must be used (different to the I2C class of the machine package which is used on other controllers). For details on the differences see https://learn.adafruit.com/micropython-hardware-i2c-devices/i2c-master. They are both incompatible so I made the approach of passing an i2c object as parameter to the MCP class. The modifications I made provide a module that can be used either on the pyboard or on other boards. The drawback is that the functions signature changes. I made a PR with my changes if you would like to include them to make this module more universal.

Kind Regards