Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.transmit() wrongly documented #3

Closed
amstan opened this issue Sep 4, 2015 · 1 comment
Closed

.transmit() wrongly documented #3

amstan opened this issue Sep 4, 2015 · 1 comment

Comments

@amstan
Copy link

amstan commented Sep 4, 2015

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.

@tomstokes
Copy link
Owner

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:

screen shot 2015-09-10 at 1 08 24 pm

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

No branches or pull requests

2 participants