I have been playing with uencoder (https://gitlab.com/WiLED-Project/uencoder) but would like to see how this could be implemented using asyncio.
I am assuming I would need to create two asyncio tasks to replace the pin interrupts
Code: Select all
if use_interrupts:
mode = Pin.IRQ_RISING | Pin.IRQ_FALLING
self.pin_A_irq = self.pin_A.irq(trigger=mode, handler=self.process)
self.pin_B_irq = self.pin_B.irq(trigger=mode, handler=self.process)
# TODO: Implement a polling-only method, with asyncio