SPI Python bits per word and readBytes
-
Does anyone knows the correct command in Python to setup a different number for "bits per word"? I have tried spi.bitsPerWord and spi.bits_Per_Word, but when running the python file appears an error. Also, in the command readBytes is necessary to specify an address from the SPI device, but isn't it redundant if you are receiving only one trails of data through the MISO line? I think some of the documentation SPI Python needs update because the instructions are not clear enough https://docs.onion.io/omega2-docs/spi-python-module.html. Thanks
-
@Jaime-Cerecer Try using the new Python spidev module we made available a few months ago: https://github.com/OnionIoT/python-spidev
Should be more straight-forward to use!
(We'll also update the Docs to point to the new module)
-
@Lazar-Demin Thank you, I will try it and let you know.
-
@Lazar-Demin Hi, it would be great to redo the Python SPI docs to point to spidev based module to avoid confusion and loss of effort.
-
The documentation for python-spidev does not explain how to change bits per word. I have some SPI devices that are 16-bit and I can't seem to figure out how to communicate with these. I get an IOError: [Errno 22] Invalid argument when setting bits_per_word to 16. Anyone have luck with this?