Hi, I am trying to use the optical sensor on a cheap mouse to track movement. I found this ps2 mouse library, and my esp32 only spits out gibberish through Serial. Below is the example code. I tested it on my Arduino Uno and it worked fine. What's the problem here?
Some additional things I found:
The mouse LED only lights up if I use the pins 5 and 6.
Baud rate doesn't matter. It always works on Uno and always doesn't work on esp32.
PS2 mouse(CLOCK_PIN, DATA_PIN); seems to be causing the problem. With this line, any serial output is gibberish. Without it, serial works.
Mouse LED brightens slightly if it detects any movement(Both on Uno and esp32)