PROGRAM LIGHT METER UAS MIKROKONTROLER DAN DASAR SCADA
OLEH NAMA
: NI PUTU AYU CANDRA DEWI
NIM
: 1615333001
KELAS
: 5D PLN
PROGRAM STUDI TEKNIK LISTRIK JURUSAN TEKNIK ELEKTRO POLITEKNIK NEGERI BALI 2018
PROGRAM LIGHT METER PADA IDE ARDUINO
//Light Meter #include LiquidCrystal lcd(9, 8, 4, 5, 6, 7); const int LED = 13; void setup() { lcd.begin (16, 2); pinMode(LED, OUTPUT); opening(); } void loop() { int analogValue = analogRead(A1); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Intensity ="); lcd.setCursor(12, 0); lcd.print(analogValue); lcd.setCursor(0, 1); lcd.print("Status LED :"); if (analogValue <= 500) { digitalWrite(LED, LOW); lcd.setCursor(13, 1);
lcd.print("OFF"); } else { digitalWrite(LED, HIGH); lcd.setCursor(13, 1); lcd.print("ON"); } delay(1000); } void opening(){ lcd.setCursor(0,0); lcd.print(" Light Meter"); lcd.setCursor(0, 1); lcd.print(" Ayu Candra Dewi"); delay(3000); lcd.clear(); }
SCHEMATIC RANGKAIAN LIGHT METER