#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int pir = 10;
bool pirValue = LOW;
int pot = A0;
int potValue = 0;
int mpotValue = 0;
void setup() {
// put your setup code here, to run once:
lcd.init();
pinMode(pir, INPUT);
pinMode(pot, INPUT);
}
void loop() {
pirValue = digitalRead(pir);
if(pirValue == HIGH){
lcd.backlight();
lcd.setCursor(11, 1);
lcd.print("party");
delay(300);
lcd.clear();
lcd.noBacklight();
lcd.setCursor(1, 1);
lcd.print("parky");
delay(300);
lcd.clear();
}else{
potValue = analogRead(pot);
mpotValue = map(potValue, 0, 1023, 0, 15);
lcd.setCursor(mpotValue,1); //nastaví kurzor
lcd.blink(); //zobrazí kurzor
}
}