File size: 401 Bytes
8e53a3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
  Manage pull down registor button input
  1 APR 2025 by Blind Author
*/
#include <Arduino.h>

const int inputPin = 4;

void setup()
{
    Serial.begin(9600);
    pinMode(inputPin, INPUT);
}

void loop()
{
    int val = digitalRead(inputPin);

    if (val == HIGH) {
        Serial.println("Button pressed");
    } else
    {
        Serial.println("Button not pressed");
    }

    delay(1000);
}