NickG
NickG

Reputation: 9820

Can't see Serial.print() outputs in Visual Studio Code from Arduino device (ESP8266)

I can't see any Serial.print() outputs in Visual Studio Code from my Arduino device (an ESP8266 in this case). I was expecting to see it on the Debug Console. Do I have something configured incorrectly?

I know my code is working as the LED is flashing but I'm not seeing any output anywhere.

Here's my code:

#include <Arduino.h>

void setup()
{
    Serial.begin(9600); // EDIT: added this line
    Serial.println("Setup...");
    pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  Serial.print("On!");
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  
  Serial.print("Off!");
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW  
  delay(1000);                       // wait for a second
}

I am using this board: https://www.waveshare.com/wiki/e-Paper_ESP8266_Driver_Board

Here is my platformio.ini file:

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino

; Custom Serial Monitor port
monitor_port = COM4

; Custom Serial Monitor speed (baud rate)
monitor_speed = 9600

Upvotes: 1

Views: 6442

Answers (2)

ben
ben

Reputation: 81

Near the bottom right of the VS Code screen is a little plug icon. Click that to open the serial monitor.

Upvotes: 8

mehdi
mehdi

Reputation: 354

Set serial port baud rate in setup() by adding this code:

Serial.begin(SERIAL_BAUD_RATE);

For example:

Serial.begin(9600);

Finaly in serial port monitor set baud rate

Upvotes: 1

Related Questions