[王老师玩ESP32系列]第二课,第一个程序
1. 目标
来一个 LED 灯闪的例子
2. 硬件
2.1 ESP32 开发板一个
2.2 led 一个
3.硬件接线
IO14 and ESP32 GND to LED
<ignore_js_op style='color: rgb(68, 68, 68); text-transform: none; text-indent: 0px; letter-spacing: normal; font-family: "Microsoft YaHei", SimHei, Verdana, Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;'>
ESP32 接 LED
3.软件
void setup() { // initialize digital pin 13 as an output. pinMode(14, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(14, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(14, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
选对串口,能并能编译通过,就可以上传到ESP32板子,然后大家看效果吧