-
The arduino-pico documentation states that it supports Serial1 (UART0) and Serial2 (UART1) and also allows reassignment of pins to these ports.
When I try the same code as above but substituting Serial2 for Serial1, I get the following error message:
Also, when I try substituting pin numbers for Serial1 using the following code, I also get an error message:
Error message when reassigning pin numbers is:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
You've got the wrong capitalization for the calls. It's |
Beta Was this translation helpful? Give feedback.
-
For the official stm32 arduino core, you have to instantiate them, like this: HardwareSerial Serial2(PA3, PA2); // rx, tx or just HardwareSerial Serial2; You might need to #include <HardwareSerial.h> too, I'm not sure. Perhaps that applies here too? See: https://github.com/stm32duino/wiki/wiki/API#hardwareserial |
Beta Was this translation helpful? Give feedback.
-
It compiles okay for me, for the Raspberry Pi Pico, kenb2054. All I did was correct these two lines:
Have you upgraded to the latest version? I'm on 1.8.0. Check your version in Tools->Board->Boards manager. |
Beta Was this translation helpful? Give feedback.
-
I am able to read from Serial1 using the default UART TX and RX pins GP0 and GP1. If I try to set the pins for Serial2, then Serial and Serial1 stop working. My windows 10 machine also reports an unknown USB device. Serial2.setRX(4); When I remove the Serial2 specific pins the system works as expected, however, I am not able to read the output from Serial2. I have also tried the latest update fixes #472 with no success. |
Beta Was this translation helpful? Give feedback.
It compiles okay for me, for the Raspberry Pi Pico, kenb2054. All I did was correct these two lines:
Have you upgraded to the latest version? I'm on 1.8.0. Check your version in Tools->Board->Boards manager.