/*
No.absen : 03
Nama : Agustin Febi Damayanti
Kelas : XI TKJ 1
Projek ke 12
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int angka;
void setup() {
// put your setup code here, to run once:
{
lcd.init();
lcd.backlight();
}
pinMode(4, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
}
int angka1;
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(4)==0){
lcd.clear();
angka++;
lcd.print("Team A Team B");
lcd.setCursor(0,1);
lcd.print(angka);
lcd.setCursor(10,1);
lcd.print(angka1);
}
if (digitalRead(9)==0){
lcd.clear();
angka1++;
lcd.print("Team A Team B");
lcd.setCursor(0,1);
lcd.print(angka);
lcd.setCursor(9,1);
lcd.print(angka1);
}
if (digitalRead(12)==0){
lcd.clear();
angka=0;
angka1=0;
}delay(150);
}