vpaeder / pymcp2221

A python driver for the Microchip MCP2221/MCP2221A USB 2.0 to I2C/UART protocol converters
https://pypi.org/project/pymcp2221
MIT License
5 stars 2 forks source link

I2C Write 0xFF to 8 bit I/O expander #4

Closed ianccole closed 1 year ago

ianccole commented 1 year ago

So, I failed to write bytes([0xff]) to I2C because i2c_write_data() is expecting a string that it can utf8 encode.

If I comment out the .encode("utf8") (Line 1116) it works.

I think writing strings to I2C devices is not very useful

vpaeder commented 1 year ago

ok makes sense, now i2c_write_data takes bytearray instead

ianccole commented 1 year ago

Thanks for the quick fix. I'll pull that in.