Ok langsung saja siapkan peralatan yang dibutuhkan :
1.Arduino
2. LCD 16x2 dan Modul i2C
3. Kabel Jumper Male-Fimale
kemudian buat rangkaian seperti gambar dibawah ini :
hubungkan :
GND modul i2C ke GND Arduino
VCC modul i2C ke 5v Arduino
SDA modul i2C ke A4 Arduino
SCL modul i2C ke a5 Arduino
Sketch Program
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.begin();
lcd.setCursor(5,0);
lcd.print("");delay(1000); lcd.print("-");delay(500);
lcd.print("A");delay(500); lcd.print("K");delay(500);
lcd.print("U");delay(500); lcd.print("-");delay(500);
lcd.setCursor(1,1);
lcd.print("B");delay(200); lcd.print("E");delay(200);
lcd.print("L");delay(200); lcd.print("A");delay(200);
lcd.print("J");delay(200); lcd.print("A");delay(200);
lcd.print("R ");delay(200); lcd.print("A");delay(200);
lcd.print("R");delay(200); lcd.print("D");delay(200);
lcd.print("U");delay(200); lcd.print("I");delay(200);
lcd.print("N");delay(200); lcd.print("0");delay(3000);
lcd.clear();
}
void loop() {
int u;
lcd.setCursor(1, 0);
lcd.print("OJO DIBULI - ANGGEK SINAU");
for (u = 0 ; u < 16; u++) {
lcd.scrollDisplayLeft();
//lcd.scrollDisplayRight();
delay(500);
}
}
sebelum upload sketch program pastikan library LCD i2c sudah terpasang, bila belum bisa di download disini
semoga membantu
ReplyDelete