#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
#define atas 12
#define bawah 11
#define kanan 10
#define kiri 9
void print_tengah(char *s, int baris){
Serial.print(strlen(s));
lcd.setCursor((16-strlen(s))/2, baris);
lcd.print(s);
}
void setup() {
Serial.begin(115200);
for(int i = 9; i<=12; i++){
pinMode(i, INPUT_PULLUP);
}
lcd.init();
lcd.backlight();
print_tengah("apa ini tengah",0);
}
void loop() {
// put your main code here, to run repeatedly:
}