Bestilt før kl. 14.00 på hverdage = afsendt samme dag 30 dages fortrydelsesret 1 års garanti
← Terug til oversigten

Ved afspilning indlæses videoen fra YouTube.

Tilslutningsdiagram og kodeeksempel

Sådan tilslutter du 1602 LCD grøn/gul baggrundsbelysning med I2C forloddet til en Arduino UNO eller ESP32, med en eksempelsketch, du kan uploade med det samme.

1602 I2C LCD Display Demo

Dette projekt forbinder et 16x2-tegns LCD via I2C til en Arduino Uno. Displayet initialiseres, tænder baggrundsbelysningen, viser en velkomstbesked på første række og tæller oppetiden i sekunder på anden række.

Tilslutningsdiagram: 1602 LCD  grøn/gul baggrundsbelysning med  I2C forloddet på en Arduino UNO
Tilslutningsdiagram · Klik for at forstørre
Tilslutningstabel: 1602 LCD  grøn/gul baggrundsbelysning med  I2C forloddet på en Arduino UNO
Tilslutningstabel · Klik for at forstørre
1602_I2C_LCD_Display_Demo.ino · kompileret og testet
/*
 * ==================================================================
 *  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>

// Common I2C addresses are 0x27 or 0x3F for 1602 LCD modules
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(115200);
  
  lcd.init();
  lcd.backlight();
  
  lcd.setCursor(0, 0);
  lcd.print(F("Hello, Arduino!"));
  Serial.println(F("LCD initialized successfully."));
}

void loop() {
  unsigned long seconds = millis() / 1000;
  
  lcd.setCursor(0, 1);
  lcd.print(F("Uptime: "));
  lcd.print(seconds);
  lcd.print(F("s   "));
  
  delay(500);
}

Nødvendige biblioteker: LiquidCrystal I2C 1.1.2

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

ESP32 med 1602 I2C LCD-display

Dette projekt viser, hvordan man forbinder og viser tekst på en 1602 LCD-skærm ved hjælp af et I2C-backpack. Der bruges en 4-kanals tovejskompatibel level shifter til sikkert at omsætte ESP32’s 3.3V I2C-signaler til de 5V-signaler, som LCD-modulet kræver. Efter upload viser LCD’et en velkomstbesked og opdaterer en oppetids-tæller hvert sekund.

Tilslutningsdiagram: 1602 LCD  grøn/gul baggrundsbelysning med  I2C forloddet på en ESP32 DevKit V1
Tilslutningsdiagram · Klik for at forstørre
Tilslutningstabel: 1602 LCD  grøn/gul baggrundsbelysning med  I2C forloddet på en ESP32 DevKit V1
Tilslutningstabel · Klik for at forstørre
ESP32_with_1602_I2C_LCD_Display.ino · kompileret og testet
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : ESP32 with 1602 I2C LCD Display
 *  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 the LCD address (commonly 0x27 or 0x3F) for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // Initialize I2C on default ESP32 pins (SDA=21, SCL=22)
  Wire.begin(21, 22);

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

  // Display greeting
  lcd.setCursor(0, 0);
  lcd.print("ESP32 LCD Demo");
  lcd.setCursor(0, 1);
  lcd.print("Uptime: ");
}

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

Nødvendige biblioteker: LiquidCrystal I2C 1.1.2

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

Set for nylig

farvet hætte til trykknap ot3321 GRØN

farvet hætte til trykknap ot3321 GRØN

€ 0,65