const int BTN_PIN = 12;
void setup() {
Serial.begin(9600);
pinMode(BTN_PIN, INPUT_PULLUP);
}
void loop() {
int state = digitalRead(BTN_PIN);
if (state == LOW) {
Serial.println("LOW");
} else {
Serial.println("HIGH");
}
}
const int BTN_PIN = 12;
void setup() {
Serial.begin(9600);
pinMode(BTN_PIN, INPUT_PULLUP);
}
void loop() {
int state = digitalRead(BTN_PIN);
if (state == LOW) {
Serial.println("LOW");
} else {
Serial.println("HIGH");
}
}