I got trouble with a seemingly dumb-proofly simple code:
import time
import pigpio
import spidev
DS = 17
STCP = 27
SHCP = 22
MR = 5
spi = spidev.SpiDev()
spi.open(0, 0)
spi.xfer([0b10011011])
Running the code gives error:
Traceback (most recent call last):
File "shiftreg.py", line 12, in <module>
spi.xfer([0b10011011])
IOError: [Errno 22] Invaild argument
I tried using spi.xfer(0b10011011), throws
TypeError: Argument must be a list of least one, but not more than 4096 integers
Using list(0b10011011) does not work, of course:
TypeError: 'int' object is not iterable
As you see, I am only at the very beginning of the code (yust waned to try out how the default SPI setup works with a shift register), so there are unused variables and imports. Since all my parenthesis are okey, the code complies well, I am pretty much in a WTF state now.
((unrelated, but if I am here with this code...) Oh, and if you know any good rescource for controlling a shift register via SPI, please let me know.)
IOError
is passed on by the module.