Can't print using: Serial.println() #617
-
I am unable to get printing working to Arduino’s console. I’m running on Windows 10 with Phil’s Raspberry PI RP2040 Boards (2.0.3). Using Arduino’s Port command, I’ve assigned the serial port to: COM 21 (Raspberry Pico Pi). Here’s my program:
After compiling and run the program (using the Green Arrow Button) I get this message:
The program runs and blinks the LED as expected. If I compile again, this time with Arduino’s Serial Console window open, I get this message:
Again the LED blinks, but nothing is printed to the serial window. Any suggestions would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Because the pico serial port is actually software-driven from the pico itself So, I'd add a |
Beta Was this translation helpful? Give feedback.
-
Thank you Earl for taking the time to respond! Your suggest mostly worked and is allowing me to print. Once in a while printing still fails no matter how long I make the delay. I've found a delay of 2000ms works just as well as 5000ms. I'm still getting an Exception when downloading resets the COM port, and another Exception about 50% of the time when opening it. Occasionally I'm also getting a notification on my Windows desktop indicating problems with the serial port. My suspicion is that the Pico's USB driver and my system are not getting along that well. Thanks again so much for all your help!!! |
Beta Was this translation helpful? Give feedback.
Because the pico serial port is actually software-driven from the pico itself
a) the upload port will disappear and a new one will appear. often at a different COM number, when an upload/reboot occurs
b) it may take several seconds before Windows recognizes the new port and sends chars to an app and so output during the first few seconds may be lost.
So, I'd add a
delay(5000)
afterSerial.begin
in yoursetup
, and then check for a new port immediately after upload and change to it in the IDE