build in led indicator

This commit is contained in:
Lurkars 2020-12-28 19:27:15 +01:00
parent 1f4be5f0d4
commit f7fc8069bd

View File

@ -29,6 +29,7 @@ void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
pinMode(HALL_PIN, INPUT); pinMode(HALL_PIN, INPUT);
pinMode(LED_BUILTIN, INPUT);
} }
void loop() void loop()
@ -41,6 +42,7 @@ void loop()
// check HALL if turned // check HALL if turned
if (digitalRead(HALL_PIN) == LOW) if (digitalRead(HALL_PIN) == LOW)
{ {
digitalWrite(LED_BUILTIN, HIGH);
if (!change) if (!change)
{ {
change = true; change = true;
@ -49,6 +51,7 @@ void loop()
} }
else else
{ {
digitalWrite(LED_BUILTIN, LOW);
change = false; change = false;
} }