by the way.. i tried changing resistors , but it still counts slowly, it feels like the button is not responding well.
i needed to hold the push button for it to count.
using this code:
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT);
pinMode(8, OUTPUT);
pinMode(10, OUTPUT);
}
int num=0;
void loop() {
// put your main code here, to run repeatedly:
lcd.begin(16,2);
if(digitalRead(2)==0){
num=num+1;
lcd.print(num);
}
else
{
lcd.print(num);
}
}```
the project is to make a counter with LCD and push button.
i have to hold the button for 2 to 3 seconds for the counter to increment +1.
my goal is to make it faster (increments with a quick push).