// 2024-08-29 _ print "Hello World" on LCD using Arduino
#include <LiquidCrystal.h>
int tim = 500;
const int rs = 12, en = 11, d4 = 6, d5 = 5, d6 = 4, d7 = 3;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
lcd.begin(16, 2); // setup the LCD's number of columns and rows:
// lcd.print("Hello World!"); // Print a text to the LCD.
}
void loop() {
// Print in Line 1
lcd.setCursor(0, 0); // set the cursor to column 0, line 0
lcd.print("Hello World"); // Print a text to the LCD.
lcd.setCursor(12, 0); // set the cursor to column 12, line 0
lcd.print("Lead"); // Print a Lead
lcd.setCursor(12, 1); // set the cursor to column 12, line 1
lcd.print("Run"); // Print a Run
// Print in Line 2
lcd.setCursor(0, 1); // set the cursor to column 0, line 1
lcd.print(millis() / 1000); // print the number of seconds since reset
lcd.setCursor(6, 1); // set the cursor to column 5, line 1
lcd.print("ABDO"); // print ABDO in the center
// condition to end
if (millis() / 1000 >20){ // counter to stop
lcd.setCursor(12, 0); // set the cursor to column 12, line 0
lcd.print("Stop"); // Print a Stop
lcd.setCursor(12, 1); // set the cursor to column 12, line 1
lcd.print("End"); // Print a End
exit(0);
}
}