#include <LiquidCrystal_I2C.h> // LCD librairy.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
#define RELAYPIN 4 // The pin at which we want to connect the relay
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn On the back light of the LCD
lcd.clear(); // Clear everything form the display
lcd.print("Relay started");
lcd.setCursor(0, 1);
lcd.print("With Bluetooth!");
pinMode(RELAYPIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(RELAYPIN, HIGH);
if(digitalRead(RELAYPIN)==1){ Serial.println("ON");}
delay(1000); // this speeds up the simulation
digitalWrite(RELAYPIN, LOW);
if(digitalRead(RELAYPIN)==0){ Serial.println("OFF");}
delay(1000);
}