#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Servo servo1;
Servo servo2;
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int irProximity1 = 2; // Sensor Infrared Proximity 1
const int irProximity2 = 3; // Sensor Infrared Proximity 2
const int buzzerPin = 4; // Active Buzzer
void setup() {
servo1.attach(5); // Servo 1
servo2.attach(6); // Servo 2
lcd.init();
lcd.backlight();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Selamat Datang");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Masukkan Coin");
}
void loop() {
if (digitalRead(irProximity1) == LOW) {
for (int countdown = 10; countdown >= 0; countdown--) {
lcd.setCursor(0, 1);
lcd.print("Countdown: " + String(countdown) + "s ");
delay(1000);
}
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Selamat Datang");
}
}