I’m using a Pi3b and a GrovePi with a wheel encoder connected to D4.
I can read signals if I use “grovepi.digitalRead(4))” but using interrupts to create a counter doesnt work. While I get a value back, it doesnt make any sense and remains static e.g. 121 or just 1
I’m looking to have the count of encoder wheel changes. I’ve accomplished the same using GPIO module and direct pin access, but I wanted to do this over the grovepi and a grove connector.
Any reasons why this wouldnt work?
import grovepi import time print('Start Program') grovepi.set_pin_interrupt(4, grovepi.COUNT_CHANGES, grovepi.CHANGE, 65535) while True: time.sleep(0.5) value = grovepi.read_interrupt_state(4) print("value is: ", value) print("raw encoder: ", grovepi.digitalRead(4))
Any suggestions? I’ve seen some comments that interrupts arent supported on the grovepi, but yet this function call is documented.