Internal Pull-Up on DFR0575 (Beetle ESP32)

userHead rohandharwadker 2023-05-25 22:50:44 498 Views1 Replies

I can't seem to get a simple switch working using the internal pull-up resistor on the DFR0575 Beetle ESP32. The following code always outputs HIGH whether the button is pressed or not:

 

`void setup() {

Serial.begin(9600);

pinMode(4,INPUT_PULLUP);

}


 

void loop() {

Serial.println(digitalRead(4));

delay(500);

}`

 

2023-05-26 11:43:14

We've done pin mapping for the Beetle-ESP32. In your code, you need to write D4. For example:

pinMode(D4,INPUT_PULLUP);

or

Serial.println(digitalRead(D4));

 

 

userHeadPic jenna