You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to your documentation one can just do received = spi.transfer([0x11, 0x22, 0xFF]). I would expect that to send a 3 bytes (17, 34, 255), but what it actually does is that it parses [0x11, 0x22, 0xFF] as [17, 34, 255] then it converts it to a string "[17, 34, 255]", then it puts that in the buffer for sending, and since the length of the array is 3 (not 13 as the string is), it only sends '[17'(aka 91, 49, 55) down the spi pipe.
I really think that str() around data is wrong.
The text was updated successfully, but these errors were encountered:
I originally had all of the functions work with binary strings, but converted them in a previous commit. Unfortunately I forgot to convert the transfer function when I did that.
Thanks for catching this and opening an issue so I could fix this. The new version should work as expected:
According to your documentation one can just do
received = spi.transfer([0x11, 0x22, 0xFF])
. I would expect that to send a 3 bytes (17, 34, 255), but what it actually does is that it parses[0x11, 0x22, 0xFF]
as[17, 34, 255]
then it converts it to a string"[17, 34, 255]"
, then it puts that in the buffer for sending, and since the length of the array is 3 (not 13 as the string is), it only sends'[17'
(aka 91, 49, 55) down the spi pipe.I really think that str() around data is wrong.
The text was updated successfully, but these errors were encountered: