• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Problem z kodem
#2
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);
}
 
Odpowiedź
  


Wiadomości w tym wątku
Problem z kodem - przez SpalonaATmega - 12-02-2024, 14:50
RE: Problem z kodem - przez SpalonaATmega - 12-02-2024, 19:27

Skocz do:


Przeglądający: 1 gości