#include <LiquidCrystal.h>
LiquidCrystal lcd(18, 5, 17, 16, 4, 0);
int btnInc1=12;
int btnDec2=14;
int btnInc3=27;
int btnInc4=26;
int btnReset=25;
int count1=0;
int count2=0;
void setup() {
Serial.begin(16, 2);
Serial.println("array of seven");
pinMode(btnInc1, INPUT_PULLUP);
pinMode(btnDec2, INPUT_PULLUP);
pinMode(btnInc3, INPUT_PULLUP);
pinMode(btnInc4, INPUT_PULLUP);
pinMode(btnReset, INPUT_PULLUP);
}
void loop() {
if(btnInc1==LOW)
{
count1++;
update_lcd();
}
if(btnInc2==LOW)
{
count1--;
update_lcd();
}
if(btnInc3==LOW)
{
count2++;
update_lcd();
}
if(btnInc4==LOW)
{
count2--;
update_lcd();
}
if(btnInc1==LOW)
{
count1=0;
count2=0;
update_lcd();
}
}
void update_lcd()
{
lcd.clear();
lcd.setcursor(3,0);
lcd.print("count1 :");
lcd.setcursor(12,0);
lcd.print(count1);
lcd.setcursor(3,1);
lcd.print("count 2 :");
lcd.setcursor(12,1);
lcd.print(count2);
}