|
|
|
|
|
by tombert
811 days ago
|
|
You can set a gpio pin mode to PULLUP, and there’s a function built in to the freertos/arduino stuff for the ESP32 to convert that gpio pin signal to an interrupt. From there you can pass in a function pointer to run upon receiving the interrupt. The rotary encoder I bought simply applies pulses to one pin when spinning clockwise, and another pin when spinning counter clockwise, so I just attached the interrupts to two separate gpio pins, and sent the updates to the mouse stuff directly in the interrupt handler. I simply moved the mouse N units to the right or left if going clockwise or counterclockwise. I’m sure it’s not ideal but it worked to play breakout. I’m still a little new to the world of microcontrollers so it’s possible that I did something dumb. |
|