Hello!
I recently installed PlatformIO for Vscode and I am running into an issue where I cannot see my Serial.println comments in the Serial Monitor.
I made sure to do monitor_speed in the ini file.
Here is my code:
U’re probably missing an entry in your platformio.ini file, some thing like
monitor_speed = 115200
Try something simple first in PlatformIO, it has a steep learning curve.
Below are my platformio.ini and main.cpp contents for a BlinkLed and ‘SerialHello’…
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
;monitor_port = COM12
monitor_speed = 115200
main.cpp
#include <Arduino.h>
void setup()
{
// initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
}
void loop()
{
Serial.println("Hello world");
// turn the LED on
digitalWrite(LED_BUILTIN, HIGH);
// wait for a second
delay(500);
// turn the LED off
digitalWrite(LED_BUILTIN, LOW);
// wait for a second
delay(500);
}
Now I found out the issue I’ve just reported doesn’t regard Serial.print itself.
The problem is related to the code flashing. Despite the [SUCCESS] report, the code is never flashed to the device.
I’ve tried to check with an ordinary serial monitor. When I try to flash with VSCode+PlatformIO, no Serial.print message is shown. But when I flash with Arduino IDE, all serial messages appear normally.