#include <LiquidCrystal.h>
LiquidCrystal lcd (12, 11, 2, 3, 4, 5);
byte opening2[8] = {0b01111, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b01111};
byte closing2[8] = {0b11110, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b11110};
byte opening[8] = {0b01111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b01111};
byte closing[8] = {0b11110, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11110};
byte full[8] = {0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111, 0b11111};
byte middle[8] = {0b11111, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b11111};
int start = 9;
bool pressed = 1;
void setup() {
lcd.begin(16, 2);
pinMode(start, INPUT_PULLUP);
lcd.createChar(0, opening2);
lcd.createChar(1, closing2);
lcd.createChar(2, middle);
lcd.createChar(3, full);
lcd.createChar(4, closing);
lcd.createChar(5, opening);
while (pressed) {
lcd.setCursor(2, 0);
lcd.write("Press Start");
pressed = digitalRead(start);
}
loading();
}
void loop() {}
void loading() {
bar();
lcd.setCursor(2, 1);
lcd.write(byte(5));
delay(50);
for (int i = 3; i < 13; i++) {
lcd.setCursor(i, 1);
lcd.write(byte(3));
delay(50);
}
lcd.setCursor(13, 1);
lcd.write(byte(4));
}
void bar() {
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("LOADING...");
lcd.setCursor(2, 1);
lcd.write(byte(0));
for (int i = 3; i < 14; i++) {
lcd.setCursor(i, 1);
lcd.write(byte(2));
}
lcd.setCursor(13, 1);
lcd.write(byte(1));
}