On the fifth (5th) time I press the rocker right I ALWAYS get the following error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 921, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 869, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.4/site-packages/pifacecommon/interrupts.py", line 339, in handle_events
function(event)
File "platypi.py", line 58, in next_option
self.update_display(os.path.basename(self.__options[self.__index]))
File "platypi.py", line 78, in update_display
lcd.home()
File "/usr/lib/python3.4/site-packages/pifacecad/lcd.py", line 251, in home
self.send_command(LCD_RETURNHOME) # set cursor position to zero
File "/usr/lib/python3.4/site-packages/pifacecad/lcd.py", line 411, in send_command
self.control_port.register_select_pin.value = 0
File "/usr/lib/python3.4/site-packages/pifacecommon/mcp23s17.py", line 358, in value
self.chip.write_bit(v, self.bit_num, self.address)
File "/usr/lib/python3.4/site-packages/pifacecommon/mcp23s17.py", line 201, in write_bit
old_byte = self.read(address)
File "/usr/lib/python3.4/site-packages/pifacecommon/mcp23s17.py", line 143, in read
return self._pyver_read(address)
File "/usr/lib/python3.4/site-packages/pifacecommon/mcp23s17.py", line 147, in _py3read
op, addr, data = self.spisend(bytes((ctrl_byte, address, 0)))
File "/usr/lib/python3.4/site-packages/pifacecommon/spi.py", line 74, in spisend
ioctl(self.fd, SPI_IOC_MESSAGE(1), transfer)
OSError: [Errno 9] Bad file descriptor
Just for curiosity sake, I added a print(self.fd) in spi.py which prints "4"
I have a function that is called when the navigation rocker is pushed to the right:
The switch event listener is set up like so:
On the fifth (5th) time I press the rocker right I ALWAYS get the following error:
Just for curiosity sake, I added a print(self.fd) in spi.py which prints "4"