to digital pin

This commit is contained in:
Lurkars 2020-12-28 16:47:45 +01:00
parent 5427168fb2
commit 5f6f2825fe

View File

@ -7,6 +7,10 @@ void setup() {
void loop() { void loop() {
int hall_value = digitalRead(HALL_PIN); int hall_value = digitalRead(HALL_PIN);
digitalWrite(LED_BUILTIN, hall_value); if (hall_value == HIGH) {
digitalWrite(LED_BUILTIN, LOW);
} else {
digitalWrite(LED_BUILTIN, HIGH);
}
delay(10); //debounce? delay(10); //debounce?
} }