在 Arduino 设备 (ESP8266) 的 Visual Studio Code 中看不到 Serial.print() 输出

Nic*_*ckG 1 arduino esp8266 arduino-esp8266

我在 Arduino 设备(本例中为 ESP8266)的 Visual Studio Code 中看不到任何 Serial.print() 输出。我期待在调试控制台上看到它。我是否配置不正确?

我知道我的代码正在工作,因为 LED 正在闪烁,但我在任何地方都没有看到任何输出。

这是我的代码:

#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
}
Run Code Online (Sandbox Code Playgroud)

我正在使用此板: https://www.waveshare.com/wiki/e-Paper_ESP8266_Driver_Board

这是我的 platformio.ini 文件:

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

; Custom Serial Monitor port
monitor_port = COM4

; Custom Serial Monitor speed (baud rate)
monitor_speed = 9600
Run Code Online (Sandbox Code Playgroud)

小智 7

VS Code 屏幕右下角附近有一个小插头图标。单击该按钮可打开串行监视器。