一、原理图
没有
使用串口1
二、代码
main.cpp
#include <Arduino.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // 配置窗口波特率
Serial.println("hello world!");
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available() > 0){ // 有数据接收
char data = Serial.read(); // 读取串口字符
Serial.println(data); // 打印出接收的字符
}
}
三、运行
打开串口,输入什么字符就打印什么字符
四、改变vscode 的波特率
打开供货才能的platformio.ini文件,输入下面这句
monitor_speed = 115200