I2C-sovitin 1602- tai 2004 LCD-näytöille, kun ohjaus halutaan kahdella datalinjalla.
SKU: OT2021-D48 Tuotenumero: AA134 EAN: 4897916523855 Sijainti: D04.08
Vaihtoehto
LCD 1604 näyttö sinisellä taustavalolla 16x4 merkkiä
€ 7,30
Katso tämä vaihtoehto
Näin kytket LCD 1602/2004 I2C-sovitin:n Arduino UNOon tai ESP32:een, mukana esimerkkisketsi, jonka voit ladata heti.
Tämä projekti näyttää, miten 1602 LCD-moduuli kytketään ja miten siihen näytetään tekstiä I2C-backpackilla. Se alustaa näytön, kytkee taustavalon päälle ja tulostaa tervehdyksen sekä reaaliaikaisen käyttöaikalaskurin. Säädä moduulin takana olevaa potentiometriä, jos tekstin kontrasti on liian suuri tai liian pieni.
/*
* ==================================================================
* 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>
// Most 1602 I2C modules use address 0x27 or 0x3F
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(115200);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello, Arduino!");
lcd.setCursor(0, 1);
lcd.print("Uptime: 0s");
Serial.println(F("1602 LCD display initialized."));
}
void loop() {
static unsigned long seconds = 0;
delay(1000);
seconds++;
lcd.setCursor(8, 1);
lcd.print(seconds);
lcd.print("s ");
Serial.print(F("Uptime (s): "));
Serial.println(seconds);
}
Tarvittavat kirjastot: LiquidCrystal I2C 1.1.2
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Tämä projekti näyttää tervetuloviestin ja käyttöajan laskurin 1602 I2C -merkkinestekidenäytöllä. 4-kanavaista kaksisuuntaista logic level shifteriä käytetään yhdistämään turvallisesti ESP32:n 3.3V I2C-signaalit LCD-backpackin vaatimiin 5V-logiikoihin. Kun virta kytketään, LCD alustuu ja päivittää käynnissä olevia sekunteja joka sekunti.
/*
* ==================================================================
* 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 the LCD address (commonly 0x27 or 0x3F) for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(115200);
// Initialize I2C communication (SDA = GPIO 21, SCL = GPIO 22)
Wire.begin(21, 22);
// Initialize the LCD
lcd.init();
lcd.backlight();
// Print greeting
lcd.setCursor(0, 0);
lcd.print("ESP32 LCD Demo");
lcd.setCursor(0, 1);
lcd.print("Uptime: 0s");
Serial.println("1602 LCD Initialized!");
}
void loop() {
// Update uptime counter every second
static unsigned long lastUpdate = 0;
if (millis() - lastUpdate >= 1000) {
lastUpdate = millis();
unsigned long seconds = millis() / 1000;
lcd.setCursor(8, 1);
lcd.print(seconds);
lcd.print("s ");
Serial.print("Uptime: ");
Serial.print(seconds);
Serial.println(" s");
}
}
Tarvittavat kirjastot: LiquidCrystal I2C 1.1.2
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Tällä moduulilla voit lisätä I2C / IIC -viestintäliitännän 1602- tai 2004 LCD-näyttöösi, jolloin LCD-näytön ohjaamiseen tarvitaan vain 2 datakaapelia.
• Käyttöjännite: 2,5 - 6 V
• tukee I2C-protokollaa
• Laitteen osoitteen asettaminen (A0 / A1 / A2)
• Taustavalon kytkeminen päälle/pois
• Kontrastin säätö mahdollista
• Mitat (P x L x K): 41,5 x 19 x 15,3 mm
Mitat
Pituus: 4,55cm
Leveys: 1,9cm
Korkeus: 1,5cm
| Mitat | 41,5 x 19 x 15,3 mm |
|---|---|
| Leveys | 1,9 cm |
| Pituus | 4,55 cm |
| Käyttöjännite | 2,5 - 6 V |
| Korkeus | 1,5 cm |
Parempi kuin 16 kaapelia
Toimii kuten odotettiin!
Etkö ole tyytyväinen? Sinulla on 30 päivää aikaa vastaanotosta palauttaa tuote.
Kaikki palautuksista
LCD 1602/2004 I2C-sovitin