12-02-2024, 19:27
juz naprawilem
oto nowy kod
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int readPin = A0;
int readValue;
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
pinMode(readPin, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
readValue = analogRead(readPin);
lcd.clear();
lcd.setCursor(1,0);
lcd.print("Poziom Wody:");
lcd.setCursor(1,1);
if( readValue < 450){
lcd.print("Niski");
}else if( readValue < 720){
lcd.print("Sredni");
}else if( readValue < 800){
lcd.print("Wysoki");
}
delay(1000);
}
oto nowy kod
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int readPin = A0;
int readValue;
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
pinMode(readPin, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
readValue = analogRead(readPin);
lcd.clear();
lcd.setCursor(1,0);
lcd.print("Poziom Wody:");
lcd.setCursor(1,1);
if( readValue < 450){
lcd.print("Niski");
}else if( readValue < 720){
lcd.print("Sredni");
}else if( readValue < 800){
lcd.print("Wysoki");
}
delay(1000);
}