Reading high Speed Incremental Encoders with PIO in Rpi Pico and C++
You could just boot the .uf2 file to the pico with encoder connected to pins GPio 16 and 17
This simple guide is aimed to help you setup and run the program successfully in no time.
follow this link https://shawnhymel.com/2096/how-to-set-up-raspberry-pi-pico-c-c-toolchain-on-windows-with-vs-code/