I'm working on a project where we use this kind of rotary encoder connected to the axoloti:
The sensor has a Z pin that sends a pulse for every rotation. We use this pulse to trigger a musical note in axoloti. The value of the Z pin is captures using GPIO PA0 through the gpio/in/digital object.
This system works well when the rotation is relatively slow (0-5 Hz). But if the rotation gets faster (5+ Hz) , it seems that gpio/in/digital doesn't always catch the pulses. It randomly catches one in four pulses. My guess is that the pulses get too short for the k-rate. Am I wrong in thinking this?
Would any of you know how to make sure my axoloti patch catches the Z pulses up to 25 Hz or so? In another environment, I would add an interrupt function after the Z changes value, just to be sure it gets caught. Can I do this in axoloti?
Thank you for your help!