[王老师玩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板子,然后大家看效果吧

 

转载于:https://www.cnblogs.com/ezezwyj/p/9485516.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值