Hello,
I am trying to make a counter that increments every time I push the button and display the value by serial. Currently, it is working but the problem is that every time that a push button the value jump from 0 to 30 or more depending of for how long I push the button down. Here is my code:
int var =0;
int botton =8;
int push
void setup(){
pinMode(botton, INPUT);
digitalRead(botton);
Serial.begin(9600);
}
void loop(){
if(digitalRead(botton)== HIGH){
var += 1;
}
Serial.println(var);
}
Please, let me know if you have any suggestion.