#include <LiquidCrystal.h>
boolean led = true;
const int rs = 11;
const int en = 10;
const int d4 = 4,d5 = 5,d6 = 6,d7 = 7;
int ledstate = 0;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
int inputpin = 12;
int outputpin = 13;
pinMode(inputpin, INPUT);
pinMode(outputpin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
ledstate = digitalRead(12);
unsigned long lcdInterval = 500;
if (ledstate == HIGH){
digitalWrite(13, HIGH);
lcd.setCursor(0,0);
lcd.print(" ");
lcd.setCursor(0,0);
lcd.print("LCD ON");
lcd.setCursor(0,1);
}else if(ledstate == LOW) {
digitalWrite(13,LOW);
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print("LED OFF");
lcd.setCursor(0,0);
}
}