I have a simple Arduino Project, 2 buttons and face a strange case that in the beginning status of buttons are 0, but after click on the button and release the status becomes 1 for long a time then back to 0, please what is the wrong??
Code:
int const BTN1_PIN=2;
int const BTN2_PIN=4;
void setup(){
pinMode(BTN1_PIN, INPUT);
pinMode(BTN2_PIN, INPUT);
Serial.begin(9600);
}
void loop(){
int status1=digitalRead(BTN1_PIN);
Serial.print("BTN1 Status :");
Serial.println(status1);
int status2=digitalRead(BTN2_PIN);
Serial.print("BTN2 Status :");
Serial.println(status2);
d