#include <LiquidCrystal_I2C.h>
#include <DHT22.h>
#define I2C_ADDR 0x27
#define LCD_COULUMNS 20
#define LCD_ROWS
int pot = A0;
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COULUMNS, LCD_ROWS);
DHT dht(DHT22);
char message1[] = "Smrdi ti dekel";
char message2[] = "Fuuuuj";
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
lcd.setCursor(1, 1);
pinMode(pot, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int potValue = analogRead(pot);
int mappPotValue = map(potValue, 0, 1023, 0, 20);
if(mappPotValue <= 10) {
for (int i = 0; i < strlen(message1); i++) {
lcd.setCursor(i, 0);
lcd.write(message1[i]);
delay(200);
}
delay(1000);
for (int i = 0; i < strlen(message2); i++) {
lcd.setCursor(i, 0);
lcd.write(message2[i]);
delay(200);
}
delay(1000);
}
}