jeremyherbert / mcp2210-python

MCP22100 python driver
MIT License
6 stars 4 forks source link

spi_exchange two-byte values #2

Closed miguelmpn closed 2 years ago

miguelmpn commented 2 years ago

Hello,

From what I understand the MCP2210 accepts values up to 59 bits. In a C# code, I usually send 2 byte values.

From your library the following code allows to send 1 byte. rx_data = self.dev.spi_exchange(bytes(255), cs_pin_number = self._channel)

What would be the best option to send two-byte values? I tried the following but the results are unexpected, is this correct? value = [0xff, 0xff] rx_data = self.dev.spi_exchange(bytes(value), cs_pin_number = self._channel)

Sorry for the noob question, this is my first python experience

miguelmpn commented 2 years ago

I see that this is the wrong place to ask, could you please delete this?

I added the question here StackOverflow