LiquidCrystal_I2C-Bibliothek
Initialisieren Sie das Display und legen Sie seine Adresse fest.
LiquidCrystal_I2C-Bibliothek ist eine kostenlose Arduino & IoT Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Arduino & IoT Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
What the Library Does
The LiquidCrystal_I2C library handles all the low-level I2C chatter for you. You just call simple commands to show text. 📚
Install It Once
Open the Library Manager in the Arduino IDE and search for LiquidCrystal_I2C. Click install and it is ready to use.
Include the Header
At the top of your sketch you add an include line so the compiler can find the library's code.
#include <LiquidCrystal_I2C.h>Create the Object
You make one lcd object that represents your display. Every command you give will go through this object.
LiquidCrystal_I2C lcd(0x27, 16, 2);The Address Argument
The first number is the I2C address. If your display stays blank, swap 0x27 for 0x3F, the other common value.
Columns and Rows
The next two numbers tell the library the size: 16 columns and 2 rows. This matches a standard 16x2 panel.
Initialize in setup
Inside setup you call lcd.init() once to wake the display and prepare it to receive text.
void setup() {
lcd.init();
}Turn On the Backlight
The screen starts dark until you call lcd.backlight(). This lights it up so the characters are readable.
lcd.backlight();Print Your First Word
Now lcd.print() sends text to the screen. Whatever you pass appears starting at the top-left corner. 🎉
lcd.print("Hello!");Clearing the Screen
Call lcd.clear() to wipe everything and move the cursor back to the start before writing fresh text.
lcd.clear();If It Stays Blank
Blank screen with backlight on usually means the wrong address. Run an I2C scanner sketch to find the real one.
Quick Check
Your sketch compiles but the LCD stays dark even with power. Which call did you likely forget?
Recap
You included LiquidCrystal_I2C, created an lcd object with its address and size, then called init and backlight. Your display is alive. ✅
Häufig gestellte Fragen
Ist die Lektion „LiquidCrystal_I2C-Bibliothek“ kostenlos?
Ja — der vollständige Text von „LiquidCrystal_I2C-Bibliothek“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Arduino & IoT Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „LiquidCrystal_I2C-Bibliothek“?
Initialisieren Sie das Display und legen Sie seine Adresse fest. Du übst Arduino & IoT Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Arduino & IoT Academy zu starten?
Keine Vorkenntnisse erforderlich. Arduino & IoT Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.
Wie lange dauert die Lektion „LiquidCrystal_I2C-Bibliothek“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Arduino & IoT Academy-Lektion Code schreiben und ausführen?
Ja. Jede Arduino & IoT Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Ein 16x2-LCD anschließen (I2C-Backpack)
- LiquidCrystal_I2C-Bibliothek
- Cursor positionieren und ausgeben
- Live-Sensor-Dashboard