Werktags vor 14:00 Uhr bestellt = am selben Tag versendet 30 Tage Widerrufsrecht 1 Jahr Garantie
← Zurück zur Übersicht

Beim Abspielen wird das Video von YouTube geladen.

Schaltplan und Codebeispiel

So schließt du den 1602 LCD blaues Backlight mit I2C vorverlötet an einen Arduino UNO oder ESP32 an, mit einem Beispiel-Sketch, den du direkt hochladen kannst.

1602 I2C LCD-Display Demo

Verbinde das 1602 I2C LCD-Display mit nur vier Kabeln mit dem Arduino Uno. Der Sketch initialisiert das Display, aktiviert die Hintergrundbeleuchtung und zeigt eine Begrüßung sowie einen Live-Uptime-Zähler an, der jede Sekunde aktualisiert wird. Stelle das kleine Potentiometer auf der Rückseite des Moduls ein, wenn der Text zu blass oder zu dunkel erscheint.

Anschlussplan: 1602 LCD blaues Backlight mit I2C vorverlötet an einem Arduino UNO
Anschlussplan · Zum Vergrößern klicken
Anschlusstabelle: 1602 LCD blaues Backlight mit I2C vorverlötet an einem Arduino UNO
Anschlusstabelle · Zum Vergrößern klicken
1602_I2C_LCD_Display_Demo.ino · kompiliert und getestet
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : 1602 I2C LCD Display Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : 1602 LCD I2C DISPLAY
 *  Libraries : LiquidCrystal I2C 1.1.2
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
// (If your display stays blank, try address 0x3F)
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(115200);
  Serial.println(F("Starting 1602 I2C LCD demo..."));

  lcd.init();
  lcd.backlight();

  lcd.setCursor(0, 0);
  lcd.print(F("Hello, World!"));
}

void loop() {
  // Display the running uptime in seconds on the second line
  unsigned long seconds = millis() / 1000;

  lcd.setCursor(0, 1);
  lcd.print(F("Uptime: "));
  lcd.print(seconds);
  lcd.print(F("s   "));

  Serial.print(F("Uptime: "));
  Serial.print(seconds);
  Serial.println(F(" s"));

  delay(1000);
}

Benötigte Bibliotheken: LiquidCrystal I2C 1.1.2

Wiring diagram and example code generated by Codey.online — https://www.codey.online

ESP32 1602 I2C LCD Display Demo

Dieses Projekt zeigt, wie man ein 5V 1602 I2C LCD-Display mit einem ESP32 über einen Logic Level Shifter für eine sichere bidirektionale Kommunikation verbindet. Das Display initialisiert sich, schaltet die Hintergrundbeleuchtung ein und zeigt eine Willkommensnachricht sowie einen laufend aktualisierten Uptime-Zähler an.

Anschlussplan: 1602 LCD blaues Backlight mit I2C vorverlötet an einem ESP32 DevKit V1
Anschlussplan · Zum Vergrößern klicken
Anschlusstabelle: 1602 LCD blaues Backlight mit I2C vorverlötet an einem ESP32 DevKit V1
Anschlusstabelle · Zum Vergrößern klicken
ESP32_1602_I2C_LCD_Display_Demo.ino · kompiliert und getestet
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : ESP32 1602 I2C LCD Display Demo
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : 1602 LCD I2C DISPLAY
 *  Libraries : LiquidCrystal I2C 1.1.2
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set LCD I2C address (commonly 0x27 or 0x3F) and dimensions (16 columns, 2 rows)
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // Initialize I2C with ESP32 default pins: SDA (GPIO 21), SCL (GPIO 22)
  Wire.begin(21, 22);
  
  lcd.init();
  lcd.backlight();
  
  lcd.setCursor(0, 0);
  lcd.print("ESP32 LCD Demo");
  lcd.setCursor(0, 1);
  lcd.print("Uptime: ");
}

void loop() {
  // Update uptime counter in seconds
  lcd.setCursor(8, 1);
  lcd.print(millis() / 1000);
  lcd.print("s  ");
  delay(500);
}

Benötigte Bibliotheken: LiquidCrystal I2C 1.1.2

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Zuletzt angesehen

Keramikkondensator - 104 - 100V - 0.1uF / 100nF / 100.000pF

Keramikkondensator - 104 - 100V - 0.1uF / 100nF / 100.000pF

€ 0,35
USB-A auf Mini-USB Kabel 0.3 Meter (Für Arduino Nano)

USB-A auf Mini-USB Kabel 0.3 Meter (Für Arduino Nano)

€ 1,15
USB-A auf USB-B-Kabel 1 Meter (für Arduino UNO und MEGA)

USB-A auf USB-B-Kabel 1 Meter (für Arduino UNO und MEGA)

€ 2,15
DC-DC Step-down mit doppeltem USB-Anschluss (LM2596) - von 6-40V auf 5V 3A

DC-DC Step-down mit doppeltem USB-Anschluss (LM2596) - von 6-40V auf 5V 3A

€ 2,40
Druckknopf | Moment | 6x6x4 Mikroschalter

Druckknopf | Moment | 6x6x4 Mikroschalter

€ 0,35
Aluminium 25mm Reduktionsmotor-Halterung mit 6 Schrauben

Aluminium 25mm Reduktionsmotor-Halterung mit 6 Schrauben

€ 2,30
Peltier-Modul 12V 36W 40x40mm TEC1-12704

Peltier-Modul 12V 36W 40x40mm TEC1-12704

€ 6,65