build in led indicator
This commit is contained in:
parent
1f4be5f0d4
commit
f7fc8069bd
@ -29,6 +29,7 @@ void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
pinMode(HALL_PIN, INPUT);
|
||||
pinMode(LED_BUILTIN, INPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
@ -41,6 +42,7 @@ void loop()
|
||||
// check HALL if turned
|
||||
if (digitalRead(HALL_PIN) == LOW)
|
||||
{
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
if (!change)
|
||||
{
|
||||
change = true;
|
||||
@ -49,6 +51,7 @@ void loop()
|
||||
}
|
||||
else
|
||||
{
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
change = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user