Skip to content

Conversation

@rgov
Copy link
Contributor

@rgov rgov commented Oct 31, 2023

This change extends the PCF8575 class to support 8-bit expanders like the PCF8574, PCA9500, and a bunch of others.

An instance of the class can be constructed with an additional gpios=8 argument. The read_gpio and write_gpio use the value passed to determine whether they should write 8 vs 16-bit values.

Note that if using 8-bit values, self._readbuf[1] remains 0, so x | (self._readbuf[1] << 8) is a no-op. Similar for self._writebuf[1].

@makermelissa
Copy link

@rgov
Copy link
Contributor Author

rgov commented Oct 31, 2023

Oh, I wasn't aware of it. I'm going to file a different bug then...

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.

2 participants