#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int val = 0;
void setup()
{
pinMode(8, OUTPUT);
pinMode(2, INPUT);
lcd.init();
lcd.backlight();
Serial.begin(9600);
}
void loop()
{
val = digitalRead(2);
if (val == HIGH)
{
digitalWrite(8, HIGH);
lcd.setCursor(0,1);
lcd.println("dispensing fog");
} else
{
digitalWrite(8, LOW);
lcd.setCursor(0,1);
lcd.println("Done! ");
Serial.println(2);
}
}