const int lowestpin=2;
const int highestpin=11;
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
String mycolour[] = {"merah", "kuning", "biru tua", "pink", "biru muda", "hijau tua", "jingga", "hijau muda", "ungu", "putih"};
void setup() {
for (int thispin = lowestpin; thispin <= highestpin; thispin++){
pinMode(thispin, OUTPUT);
}
lcd.init();
lcd.backlight();
}
void loop() {
for (int thispin = lowestpin; thispin <= highestpin; thispin++)
{
lcd.setCursor(0,4);
lcd.print(mycolour[thispin-2]);
for (int brightness = 0; brightness <= 255; brightness+=5){
analogWrite(thispin, brightness);
delay(2);
}
for (int brightness = 255; brightness >= 0; brightness-=5){
analogWrite(thispin, brightness);
delay(2);
}
lcd.clear();
delay(200);
}
}