|
esp32 c3 合宙 9.9还包宙,真香,试了下点灯无问题,准备放下落灰的时候,发现在blink 中led关不上,反复试验,是digitalRead()读出的状态一直是0,github 上 有人讨论,可惜英语太拉垮 https://github.com/espressif/arduino-esp32/issues/5467 https://github.com/espressif/arduino-esp32/issues/5552
在点灯上只能读出状态0,求大神指导
- #define LED1 12
- #define LED2 13
- void setup() {
- Serial.begin(115200);
- pinMode(LED1, OUTPUT);
- pinMode(LED2, OUTPUT);
- }
- // the loop function runs over and over again forever
- void loop() {
- digitalWrite(LED1, HIGH);
- Serial.printf("状态%d",digitalRead(LED1));
- //digitalWrite(LED2, LOW);
- delay(500);
- digitalWrite(LED1, LOW);
- Serial.printf("状态%d",digitalRead(LED1));
- //digitalWrite(LED2, HIGH);
- delay(500);
- // breath();
- // analogWrite(LED1,0);
- }
复制代码
|
|