The Arduino serial monitor works differently to any of the utilities you can use with PlatfomIO. With it you can type a line of text, none of which is sent to the Arduino board until you click the send
button.
With screen
, miniterm
or VSCode’s terminal, you are typing directly at the Arduino’s USART so your while
loop is finding one character each time around.
Fixes?
- Type faster!
- Type into an editor, copy the required text, paste into the terminal window - that sometimes works for shorter texts.
- Use a terminal that can do line mode. But I’ve not found one yet!
- Use the Arduino IDE and Serial Monitor.
Open the Arduino IDE and configure the port to suit your board. Then, once you have uploaded with PlatformIO you can open the Arduino serial monitor, set the baud rate and start typing.
You may need to add some of these parameters to platforio.ini
to make it work, definitely monitor_port
and maybe monitor_speed
:
https://docs.platformio.org/en/latest/projectconf/section_env_monitor.html
You must close the serial monitor when you need to recompile and upload your code.
I have searched for ways to put the various terminal utilities I have used into line mode, but failed. so far. Hence, when I need to talk to my boards, I use the Arduino IDE’s serial monitor.
HTH
Cheers,
Norm.