#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C a(0x27, 2, 16);
int b, c;
void setup() {
// put your setup code here, to run once:
a.init();
a.backlight();
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
a.print(" Projek M.A.Y");
}
void loop() {
if (digitalRead(4) == 0) {
b++;
}
if (digitalRead(3) == 0) {
c++;
}
if (digitalRead(4) == 0 | digitalRead(3) == 0) {
a.clear();
a.setCursor(0, 0);
a.print(" tim A tim B ");
a.setCursor(4, 1);a.print(b);
a.setCursor(12,1);a.print(c);
}
if (digitalRead(2) == 0) {
c = 0; b = 0;
a.clear();
a.print("semua angka");
a.setCursor(0, 1);
a.print("tereset");
}
delay(70);
}