#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7); // RS, EN, D4, D5, D6, D7 ]
int line[][8] = {
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
(2, 1, 2, 3, 4, 5, 2, 6),
};
uint8_t line0[] = { 0, 0, 0, 0, 0, 0, 0, 9};
uint8_t line1[] = { 0, 0, 0, 0, 0, 0, 18, 0};
uint8_t line2[] = { 0, 0, 0, 0, 0, 9, 0, 0};
uint8_t line3[] = { 0, 0, 0, 0, 18, 0, 0, 0};
uint8_t line4[] = { 0, 0, 0, 9, 0, 0, 0, 0};
uint8_t line5[] = { 0, 0, 18, 0, 0, 0, 0, 0};
uint8_t line6[] = { 0, 9, 0, 0, 0, 0, 0, 0};
uint8_t line7[] = {18, 0, 0, 0, 0, 0, 0, 0};
void setup() {
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(1, 1);
lcd.print(line[3][4]);
lcd.createChar(0, line0);
lcd.createChar(1, line1);
lcd.createChar(2, line2);
lcd.createChar(3, line3);
lcd.createChar(4, line4);
lcd.createChar(5, line5);
lcd.createChar(6, line6);
lcd.createChar(7, line7);
}
void loop() {
for (int i = 0; i < 8; i++) {
lcd.setCursor(0, 0);
lcd.write(int(i));
delay(100);
}
}