Dec-16-2016, 10:17 PM
The example uses time.sleep() to wait before cancelling it.
pi = pigpio.pi() decoder = rotary_encoder.decoder(pi, 7, 8, callback) time.sleep(300) decoder.cancel() pi.stop()It sounds like you don't actually want to call decoder.cancel(), though... it sounds like you want it to just run forever, while the callbacks get handled. So maybe...
decoder = rotary_encoder.decoder(#etc) while True: # handle events # so the pi doesn't melt :) time.sleep(500)