I’m using a Serial.begin(115200) and some Serial.println() since I was being used to it when using the Arduino platform.
Now I turned to use platform.io and I’m performing first steps. When I open the “Terminal” I’m seeing (in the time period the println() are occuring, not the actual printed text but some garbage as one is being used to see when the baud rate is wrong.
As a shot in the dark I changed the baudrate in Serial.begin to 9600, which made the println text appear correctly.
Where in the platform.io IDE can I set tha baudrate of the Terminal?
Alternatively, when you run the pio device monitor command, you can specify the baud rate there too.
pio device monitor --baud 115200
You can abbreviate --baud to -b if you wish. The command pio device monitor --help is your friend. Always assuming that you execute the device monitor on the command line of course!
Obviously, the default baud rate is 9600 and this must agree with what you specify in your code.
Thanks. Saving the file and restarting the IDE helped.
Since I’m running under macOS I never know whether to use [CTRL]+[E] or ⌘+E, since copy/paste work on ⌘-C, ⌘-V resp.
I don;t use a Mac, but I assume (always a bad idea) that just saving the file should work with no need to restart the IDE. I’m on Linux, and never need to do anything other than CTRL+S to save the current file.
Any time you make a change to platformio.ini you will need to save it before compiling. Just to be on the safe side.
About the only thing I know about Macs is that this key, ‘⌘’, is the command key, which is Windows/Linux CTRL key. So, yes, ⌘+S would save the current file.