Hey there,
I’m trying to include the Encoder library on a Pi Pico and am getting some errors. The latest version of the Encoder library supports the Arduino Nano RP2040 Connect, so I think it should work with the Pi Pico as well, however I’m seeing a series of errors.
First series of errors that I got was related to the definition of interrupts, as follows:
.pio\libdeps\picow\Encoder/utility/interrupt_pins.h:390:2: error: #error “Interrupts are unknown for this board, please add to this code”
390 | #error “Interrupts are unknown for this board, please add to this code”
| ^~~~~
.pio\libdeps\picow\Encoder/utility/interrupt_pins.h:393:2: error: #error “Encoder requires interrupt pins, but this board does not have any :(”
393 | #error “Encoder requires interrupt pins, but this board does not have any :(”
To fix this, I defined a build flag ARDUINO_NANO_RP2040_CONNECT for the Pico.
I thought that would work, however, I started getting a different error then,
C:\Users---------.platformio\packages\framework-arduinopico\cores\rp2040\SerialPIO.cpp:385:19: error: ‘SERIAL3_TX’ was not declared in this scope
Compiling .pio\build\picow\FrameworkArduino\api\Stream.cpp.o
385 | SerialPIO Serial3(SERIAL3_TX, SERIAL3_RX);
| ^~~~~~~~~~
C:\Users-----------.platformio\packages\framework-arduinopico\cores\rp2040\SerialPIO.cpp:385:31: error: ‘SERIAL3_RX’ was not declared in this scope
385 | SerialPIO Serial3(SERIAL3_TX, SERIAL3_RX);
I looked into the SerialPIO.cpp file, and sure enough there is a definition that relies on the same flag
#ifdef ARDUINO_NANO_RP2040_CONNECT
// NINA updates
SerialPIO Serial3(SERIAL3_TX, SERIAL3_RX);
#endif
I don’t really know what this is doing, but then I tried adding a new build flag replacing SERIAL3_TX and SERIAL3_RX with pin numbers as
-D SERIAL3_TX 16
-D SERIAL3_RX 17
and then I get an even weirder error
*** [.pio\build\picow\firmware.elf] Implicit dependency
C:\Users\------------ \.platformio\platforms\raspberrypi@src-ff76a3915224135aafad379817f41edd\builder\16' not found, needed by target
.pio\build\picow\firmware.elf’.
Has anyone ever seen this issue before? I’d appreciate any help
Thanks!