SCRIPT ARDUINO LCD 16*2

mail@pastecode.io avatar
unknown
plain_text
3 years ago
435 B
42
Indexable
Never
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

int x;

void setup() {

  
 Serial.begin(115200);
 Serial.setTimeout(1);
 lcd.init();
   
}
void loop() {
 while (!Serial.available());
 x = Serial.readString().toInt();
 Serial.print(x + 1);
 lcd.backlight();
 lcd.setCursor(0,0);
 lcd.print("nilai: ");
 lcd.setCursor(0,1);
 lcd.print(x);
 delay(1000);
// lcd.clear();
}