/* PROGRAM SORTIR BARANG BY :
Nama : Jonas Mal Octavidi Silalahi
Kelas : X
Jurusan : Teknik Elektronika
Tanggal : 27 Februari 2023
For : Pak Kuswanda
*/
#include <LiquidCrystal.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int led=3;
int pb=8;
int pbstatus=0;
int hitungpb;
LiquidCrystal_I2C lcd(0*27,16,2);
void setup() {
pinMode(led, OUTPUT);
pinMode(pb, INPUT);
lcd.begin(16,2);
lcd.print("ALAT SORTIR BARANG");
}
void loop() {
pbstatus=digitalRead(pb);
if (pb==HIGH)
{
digitalWrite (led,HIGH);
Serial.println("lCD ON");
lcd.setCursor(0,0);
lcd.print("LCD ON");
}
else{
digitalWrite (led,LOW );
Serial.println("LCD OFF");
lcd.setCursor(0,1);
lcd.println("LCD OFF");
}
}