Created
November 30, 2023 02:38
-
-
Save schappim/452f85ebb49b277c96f44f4f298d902d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
// Set the LCD address to 0x20 for a 20 chars and 4 line display | |
LiquidCrystal_I2C lcd(0x20, 20, 4); | |
void setup() { | |
// Initialize the LCD | |
lcd.init(); // or lcd.begin(); | |
lcd.backlight(); | |
// Clear the display | |
lcd.clear(); | |
// Set the cursor to column 5, row 0 | |
// Remember that counting starts from 0 so the first column is 0 and the first row is 0 | |
lcd.setCursor(5, 0); | |
// Print a message to the LCD | |
lcd.print("Hello, world!"); | |
} | |
void loop() { | |
// Main code does not need to run repeatedly in this case | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment