/* * Programmer: R. Jordan Kreindler * August 8, 2020 * Arrow Animation */ #include LiquidCrystal_I2C lcd(0x27, 16, 2); // Set I2C address to 0x27 byte arrow[] = { B01000, B00100, B00010, B11111, B11111, B00010, B00100, B01000 }; byte nothing[] = { B00000, B00000, B00000, B00000, B00000, B00000, B00000, B00000 }; int delay1 = 200; void setup() { lcd.init(); lcd.backlight(); lcd.createChar(0, arrow); lcd.createChar(1, nothing); lcd.home(); } void loop() { lcd.setCursor(0, 0); lcd.print(" Animation "); for(int i = 0; i <= 15; i++) { lcd.setCursor(i, 1); lcd.write(0); delay(delay1); // Delay long enough to see arrow lcd.setCursor(i, 1); lcd.write(1); } lcd.clear(); }