pimoroni / ioe-python

Python library for the Nuvoton MS51 Pimoroni IO Expander Breakout
https://shop.pimoroni.com/products/io-expander
MIT License
8 stars 13 forks source link

`rotary.py` not working with Pi 5 / Bookworm #30

Open helgibbons opened 4 months ago

helgibbons commented 4 months ago

I'm getting:

(pimoroni) hel@heltest:~/ioe-python/examples $ python rotary.py
rotary.py

Change the I2C_ADDR to:
 - 0x0F to use with the Rotary Encoder breakout.
 - 0x18 to use with IO Expander.

Press Ctrl+C to exit.

Traceback (most recent call last):
  File "/home/hel/ioe-python/examples/rotary.py", line 30, in <module>
    ioe = io.IOE(i2c_addr=I2C_ADDR, interrupt_pin=4)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hel/.virtualenvs/pimoroni/lib/python3.11/site-packages/ioexpander/__init__.py", line 843, in __init__
    _IO.__init__(self, i2c_addr, interrupt_timeout, interrupt_pin, interrupt_pull_up, gpio, smbus_id, skip_chip_id_check, perform_reset)
  File "/home/hel/.virtualenvs/pimoroni/lib/python3.11/site-packages/ioexpander/__init__.py", line 205, in __init__
    self._gpio.setup(self._interrupt_pin, GPIO.IN, pull_up_down=GPIO.PUD_OFF)
RuntimeError: Cannot determine SOC peripheral base address
helgibbons commented 4 months ago

It works with interrupt_pin=None.