https://dl.espressif.com/dl/package_esp32_index.json
复制代码
开发板型号 esp32 dev modulegit
改主题请参考这个github
#define LED 5
void setup() {
// put your setup code here, to run once:
pinMode(LED, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED,HIGH); //高电平
delay(1000); //等待1000毫秒
digitalWrite(LED, LOW); //低电平
delay(1000); //等待1000毫秒
}
复制代码
#define LED 5
#define botton 0
void setup() {
// put your setup code here, to run once:
pinMode(LED, OUTPUT);
pinMode(botton,INPUT_PULLUP); //内部上拉
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(botton)){
digitalWrite(LED,HIGH); //高电平
}else{
digitalWrite(LED,LOW); //低电平
}
}
复制代码