Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This example will display "Hello!" on the first line of the LCD and the number of seconds since the Arduino was last reset on the second line. You can adjust this code to display any other text or variable values as per your requirements.
- Remember to connect the LCD RS, E, and data lines (D4-D7) to the Arduino digital pins specified in the LiquidCrystal lcd(rs, en, d4, d5, d6, d7); line.
- */
- #include <LiquidCrystal.h>
- // Initialize the library by associating any needed LCD interface pin
- // with the arduino pin number it is connected to
- const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
- LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
- void setup() {
- // set up the LCD's number of columns and rows:
- lcd.begin(8, 2);
- // Print a message to the LCD
- lcd.print("Hello!");
- }
- void loop() {
- // set the cursor to column 0, line 1
- lcd.setCursor(0, 1);
- // print the number of seconds since reset:
- lcd.print(millis() / 1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement