Cov txheej txheem:
- Kauj Ruam 1: Ntxiv ESP8266 rau Koj Arduino IDE
- Kauj Ruam 2: I2C LCD Library
- Kauj Ruam 3: Txuas lub LCD
- Kauj Ruam 4: Luam theej I2C Bus rau Qhov Chaw Nyob raug
- Kauj Ruam 5: Tshaj Tawm Cov Ntawv ntawm Koj Lub LCD
- Kauj Ruam 6: Cov Lus Qhia Ntxiv
Video: I2C LCD ESP8266: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Peb ua ntau ESP8266 raws cov phiaj xwm, thiab txawm hais tias feem ntau ntawm lawv yog rau IOT thiab lub vev xaib raws cov phiaj xwm, nws yooj yim kom muaj lub vijtsam LCD hauv cheeb tsam kom pom dab tsi tshwm sim.
I2C zoo meej rau I/O cov cuab yeej yam tsis muaj I/O pins muaj ntau, vim nws tsuas yog siv ob tus I/O tus pin. Cov qauv LCD no muaj ntau, tab sis muaj ntau qhov chaw nyob, yog li cia peb tau txais kev sib txuas lus nrog ESP8266, txuas lub vijtsam rau esp8266 module, thiab khiav I2C chaw nyob scanner kom pom qhov chaw nyob uas peb xav tham nrog. Cov theem hauv qab no yuav ua rau koj txheeb.
Kuv tab tom siv Adafruit Feather HUZZAH ESP8266 module, thiab Sunfounder 20x4 xiav LCD.
Kauj Ruam 1: Ntxiv ESP8266 rau Koj Arduino IDE
Ua ntej koj tuaj yeem siv ESP8266 nrog Arduino IDE, koj yuav tsum ntxiv kev txhawb nqa rau ESP8266 (pom hauv "tus thawj tswj hwm pawg thawj coj url" teb saum toj no). Adafruit muab cov kev qhia qhia rau cov qib no ntawm
Kauj Ruam 2: I2C LCD Library
Koj yuav tsum tau ua kom ntseeg tau tias koj tau txais I2C LCD tsev qiv ntawv los ntawm https://github.com/marcoschwartz/LiquidCrystal_I2…, txwv tsis pub cov cai yuav tsis upload. Koj tuaj yeem tau txais lus ceeb toom tias lub tsev qiv ntawv tsuas yog ntawv pov thawj rau AVR's, tab sis nws tseem ua haujlwm tau zoo ntawm ESP8266.
Luam cov ntaub ntawv, thiab theej lawv mus rau "I2C LCD" nplaub tshev hauv cov tsev qiv ntawv nplaub tshev hauv koj daim nplaub tshev daim duab (tau teev tseg hauv "nyiam - qhov chaw sketchbook" raws li pom saum toj no).
Kauj Ruam 3: Txuas lub LCD
ESP8266 thiab LCD module tau hais meej cov cim npe, yog li txuas raws li hauv qab no:
SCL - SCL
SDA - SDA
VCC - USB (yog, nws yog 5v, tab sis I2C ntawm 3.3v ESP8266 tsis yws)
Gnd - Yog
Nco ntsoov: VCC yuav tsum yog 5v tshwj tsis yog tias koj muaj 3.3v tso saib tau. Tsis muaj qib hloov pauv tsim nyog rau I2C pins.
Kauj Ruam 4: Luam theej I2C Bus rau Qhov Chaw Nyob raug
I2C yog ob txoj kab hlau txuas uas tso cai rau siv ntau yam khoom siv, nrog tsuas yog ob tus pin siv ntawm lub microcontroller. Qhov no ua tiav los ntawm kev teeb tsa chaw nyob ntawm txhua lub cuab yeej ntawm lub npav. Tsis yog txhua I2C LCD siv tib qhov chaw nyob.
Muaj qhov chaw nyob scanner code koj tuaj yeem ua haujlwm uas yuav tshaj tawm qhov chaw nyob txhua qhov khoom siv I2C txuas nrog. Koj tuaj yeem tau txais tus lej rau I2C scanner ntawm
Kev xa cov duab kos pom kuv hauv cov ntawv saib uas kuv tau siv chaw nyob 0x27, yog li kuv tau rub cov duab hauv qab no thiab ua kom ntseeg tau tias nws tau sim sib tham ntawm qhov chaw nyob raug, thiab qhov loj me. Qhov loj me ntawm cov vijtsam yog 20x4, thiab 16x2.
LiquidCrystal_I2C lcd (0x27, 20, 4);
Kauj Ruam 5: Tshaj Tawm Cov Ntawv ntawm Koj Lub LCD
Kuv tau suav nrog cov qauv kos duab los qhia koj yuav ua li cas tso tawm cov ntawv ntawm koj lub LCD.
Koj tuaj yeem tau txais txoj cai rau I2C LCD ntawm
Tus yuam sij kom tau txais qhov tso tawm qhov twg koj xav tau yog kab ntawv tau teeb ua ntej, tom qab ntawv tus lej kab, ob qho pib ntawm 0.
// Txav tus cursor 5 tus cim mus rau sab xis thiab // xoom cim qis (kab 1).
lcd.setCursor (5, 0);
// Luam tawm HELLO rau lub vijtsam, pib ntawm 5, 0.
lcd.print ("HLO");
Kauj Ruam 6: Cov Lus Qhia Ntxiv
Koj tuaj yeem kawm paub ntau ntxiv txog kev siv ESP8266 nrog Arduino IDE ntawm
Thiab kawm paub tswj hwm koj li ESP8266 nrog Amazon Alexa/Echo platform ntawm
Pom zoo:
Hloov-Hloov Cov Khoom Ua Si: Cov Khoom Ua Si Cov Khoom Ua Si Ua Tau Zoo!: 7 Cov Kauj Ruam (nrog Duab)
Hloov-Hloov Cov Khoom Ua Si: Cov Khoom Siv Hluav Taws Xob Ua Tau Zoo!: Qho khoom ua si hloov pauv qhib txoj hauv kev tshiab thiab kev daws teeb meem kom tso cai rau menyuam yaus uas muaj lub cev muaj peev xwm txwv lossis kev xiam oos qhab kev loj hlob los cuam tshuam nrog cov khoom ua si ntawm nws tus kheej. Hauv ntau qhov xwm txheej, cov menyuam yaus uas xav tau cov khoom ua si hloov pauv tsis tuaj yeem nkag mus
Cov av noo noo Cov Lus Qhia Tswj Xyuas Internet Txuas Cov Dej Dej (ESP32 thiab Blynk): 5 Cov Kauj Ruam
Cov av noo noo Cov lus pom zoo Tswj Xyuas Internet Txuas Cov Dej Dej (ESP32 thiab Blynk): Tsis txhawj xeeb txog koj lub vaj lossis nroj tsuag thaum koj mus rau hnub so ntev, lossis tsis nco qab ywg dej koj cov nroj tsuag txhua hnub. Zoo ntawm no yog kev daws teeb meem Nws cov av ya raws tswj hwm thiab thoob ntiaj teb txuas nrog cov dej txau dej tswj los ntawm ESP32 ntawm software pem hauv ntej kuv
I2C / IIC LCD Zaub - Siv SPI LCD rau I2C LCD Zaub Siv SPI rau IIC Module Nrog Arduino: 5 Kauj Ruam
I2C / IIC LCD Zaub | Siv SPI LCD rau I2C LCD Zaub Siv SPI rau IIC Module Nrog Arduino: Nyob zoo cov phooj ywg txij li ib txwm muaj SPI LCD 1602 muaj xov tooj ntau dhau los txuas yog li nws nyuaj rau cuam tshuam nrog arduino tab sis muaj ib qho qauv muaj nyob hauv khw uas tuaj yeem hloov SPI zaub rau hauv IIC zaub yog li ntawd koj yuav tsum txuas tsuas yog 4 xov hlau
I2C / IIC LCD Zaub - Hloov SPI LCD rau I2C LCD Zaub: 5 Kauj Ruam
I2C / IIC LCD Zaub | Hloov SPI LCD mus rau I2C LCD Zaub: siv spi lcd zaub xav tau kev sib txuas ntau dhau los ua qhov uas nyuaj heev ua li ntawd kuv pom tus qauv uas tuaj yeem hloov pauv i2c lcd mus rau spi lcd yog li cia peb pib
DIY I2C LCD Zaub Nrog Cov Lus Qhia: 6 Cov Kauj Ruam
DIY I2C LCD Zaub Nrog Cov Lus Qhia: Qhov sib xws LCD siv nrog Arduino (16x2 lossis 20x4) muaj 16 tus pin. Tsuas yog 6 tus I/O tus pin xav tau ntawm Arduino, tab sis ua li cas yog tias koj tuaj yeem tau txais qhov ntawd mus rau ob I/O pins, thiab tseem muaj cov pins muaj rau lwm yam khoom siv? I2C interface yog