#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd (0x27, 16, 2);
int pinLED_RED = 10;
int pinLED_GREEN = 11;
int pinLED_BLUE = 12;
int pinLED_ORANGE = 13;
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
pinMode(pinLED_RED, OUTPUT);
pinMode(pinLED_GREEN, OUTPUT);
pinMode(pinLED_BLUE, OUTPUT);
pinMode(pinLED_ORANGE, OUTPUT);
}
void loop() {
pinLED_RED_ON();
pinLED_GREEN_ON();
pinLED_BLUE_ON();
pinLED_ORANGE_ON();
pinLED_BLUE_ON();
pinLED_GREEN_ON();
}
void pinLED_RED_ON() {
// put your main code here, to run repeatedly:
digitalWrite(pinLED_RED, HIGH);
lcd.setCursor(3, 0);
lcd.print(" LED MERAH ");
lcd.setCursor(4, 1);
lcd.print (" MENYALA ");
delay (1000);
lcd.clear();
digitalWrite(pinLED_RED, LOW);
}
void pinLED_GREEN_ON() {
// put your main code here, to run repeatedly:
digitalWrite(pinLED_GREEN, HIGH);
lcd.setCursor(3, 0);
lcd.print(" LED HIJAU ");
lcd.setCursor(4, 1);
lcd.print (" MENYALA ");
delay (1000);
lcd.clear();
digitalWrite(pinLED_GREEN, LOW);
}
void pinLED_BLUE_ON() {
// put your main code here, to run repeatedly:
digitalWrite(pinLED_BLUE, HIGH);
lcd.setCursor(3, 0);
lcd.print(" LED BIRU ");
lcd.setCursor(4, 1);
lcd.print (" MENYALA ");
delay (1000);
lcd.clear();
digitalWrite(pinLED_BLUE, LOW);
}
void pinLED_ORANGE_ON() {
// put your main code here, to run repeatedly:
digitalWrite(pinLED_ORANGE, HIGH);
lcd.setCursor(3, 0);
lcd.print(" LED JINGGA ");
lcd.setCursor(4, 1);
lcd.print (" MENYALA ");
delay (1000);
lcd.clear();
digitalWrite(pinLED_ORANGE, LOW);
}