I’ve been trying to read the status of a button on GPIO1 for a while now, but I can’t. Maybe I’m making a mistake, can someone help me and tell me what I’m doing wrong with the sketch below?
#define BUTTON_PIN GPIO1
void setup() {
Serial.begin(115200);
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(Vext,OUTPUT);
digitalWrite(Vext,LOW);
}
void loop() {
byte buttonState = digitalRead(BUTTON_PIN);
if (buttonState == LOW) {
Serial.println("Button is pressed");
}
else {
Serial.println("Button is not pressed");
}
delay(100);
}