/* II2C 1602 Variables Display Written July 27, 2020 by R Jordan Keindler */ #include LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display int delay1 = 500; void setup() { lcd.init(); // initialize the lcd lcd.backlight(); // Turn backlight On } void loop() { lcd.clear(); lcd.setCursor(3, 0); // Set cursor at position three(3) on first line of 1602 LCD for (int i = 0; i <= 9; i++) { lcd.print(i); // Display succesive values of variable i delay(delay1); // Delay delay1 after each display of i } lcd.setCursor(3, 1); // Set cursor at position three(3) on 2nd line of 1602 LCD for (int i = 9; i >= 0; i--) { lcd.print(i); // Display succesive values of variable i delay(delay1); // Delay delay1 after each display of i } }