#include <LiquidCrystal_I2C.h>
#define POT_PIN A0
#define LED_PIN 10
LiquidCrystal_I2C lsd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
lsd.begin(9600);
pinMode(A4, INPUT);
pinMode(A5, INPUT);
}
void loop() {
int pot;
pot = analogRead(POT_PIN);
if(pot < 500){
Serial.println(pot);
digitalWrite(LED_PIN, HIGH);
lsd.setCursor(5,0);
lsd.print("светодиот горит");
}
else{
Serial.println(pot);
digitalWrite(LED_PIN, LOW);
lsd.setCursor(5,0);
lsd.print("светодиот не горит");
}
}