2
Arduino IDE로 첫 번째 ESP32 보드를 설정하려고했습니다. 내장 LED로는 잘 작동하지만 핀에는 사용할 수 없습니다. 여기 내 코드입니다 :Arduino IDE에서 ESP32 핀 출력이 작동하지 않습니다.
int LED_BUILTIN = 2; // works fine
int LED_OUT = 25; // not working, even other pins
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LED_OUT, OUTPUT);
Serial.begin(115200);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
// turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW);
// turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(LED_OUT, HIGH);
// turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_OUT, LOW);
// turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
내장 LED가 내 코드에 따라하지만, GPIO (25)는 아무것도 출력되지 깜박이는 온보드. 나는 다른 핀을 시험해 보았다. GPIO 4를 시험해보고 LED가 깜박이는 것을 발견했습니다. GPIO 4가 내장 LED에 연결되어있는 것처럼 보입니다.
핀 모드를 설정하는 데 아무 것도 그리워 했나요? 브레드 보드에 LED가 깜박이도록 핀을 선택하고 출력으로 작동 시키려면 어떻게해야합니까?
미리 감사드립니다.