// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal layar(rs, en, d4, d5, d6, d7);
byte customChar1[] = {
B10010,
B01001,
B00100,
B00010,
B00010,
B00100,
B01001,
B10010
};
byte customChar2[] = {
B00000,
B00000,
B10000,
B01111,
B01111,
B10000,
B00000,
B00000
};
byte customChar3[] = {
B00100,
B01110,
B11111,
B11111,
B01111,
B00111,
B00011,
B00001
};
byte customChar4[] = {
B00100,
B01110,
B11111,
B11111,
B11110,
B11100,
B11000,
B10000
};
byte customChar5[] = {
B00000,
B00000,
B00000,
B11111,
B11111,
B00000,
B00000,
B00000
};
byte customChar6[] = {
B10000,
B11000,
B11100,
B11111,
B11111,
B11100,
B11000,
B10000
};
int i = 0;
void setup() {
// set up the LCD's number of columns and rows:
layar.begin(16, 2);
layar.createChar(0, customChar1);
layar.createChar(1, customChar2);
layar.createChar(2, customChar3);
layar.createChar(3, customChar4);
layar.createChar(4, customChar5);
layar.createChar(5, customChar6);
}
void loop() {
for(int n = 0; n < 6; n++)
{
layar.setCursor(n+5,0);
layar.write(n);
}
layar.setCursor(0,1);
layar.write("Monitor Listrik");
}