Cov txheej txheem:

Interface LED Dot Matrix (8x8) Nrog NodeMCU: 6 Cov Kauj Ruam (nrog Duab)
Interface LED Dot Matrix (8x8) Nrog NodeMCU: 6 Cov Kauj Ruam (nrog Duab)

Video: Interface LED Dot Matrix (8x8) Nrog NodeMCU: 6 Cov Kauj Ruam (nrog Duab)

Video: Interface LED Dot Matrix (8x8) Nrog NodeMCU: 6 Cov Kauj Ruam (nrog Duab)
Video: Atmega16 interfacing with 8*8 Dot Matrix Display 2024, Kaum ib hlis
Anonim
Interface LED Dot Matrix (8x8) Nrog NodeMCU
Interface LED Dot Matrix (8x8) Nrog NodeMCU

Nyob Zoo Makers,

Kuv nrog lwm qhov yooj yim thiab txias Qhia.

Hauv Cov Lus Qhia no peb yuav kawm paub cuam tshuam li cas LED Dot Matrix (8x8) nrog NodeMCU.

Yog li, cia pib.

Kauj Ruam 1: Yam Yuav Tsum Tau

Yam Uas Xav Tau
Yam Uas Xav Tau

Nov yog cov khoom xav tau los ua Cov Lus Qhia no.

Yuav Tsum Tau Kho Vajtse

  • LED Dot Matrix (8x8)
  • NodeMCU
  • Jumper xov hlau / Txuas xov hlau (Yeem xaiv)
  • BreadBoard
  • Micro USB Cable

Software Yuav Tsum Tau

Arduino IDE (nrog ESP8266 lub tsev qiv ntawv teeb tsa)

Kauj ruam 2: Kev piav qhia

Nqe lus piav qhia
Nqe lus piav qhia
Nqe lus piav qhia
Nqe lus piav qhia
Nqe lus piav qhia
Nqe lus piav qhia

LED Dot Matrix lossis LED Zaub yog qhov loj, daws teeb meem tsawg ntawm dot-matrix zaub.

Nws muaj txiaj ntsig zoo rau kev lag luam thiab lub hom phiaj kev lag luam, los tso saib cov ntaub ntawv nrog rau kev nyiam ua haujlwm tib neeg -tshuab cuam tshuam.

Nws suav nrog 2-D diode matrix nrog lawv cov cathodes koom ua ke thiab lawv cov anodes koom nrog hauv kab (lossis hloov pauv).

Los ntawm kev tswj cov hluav taws xob ntws los ntawm txhua kab thiab kab khub nws tuaj yeem tswj hwm txhua tus LED ib tus zuj zus.

Kauj Ruam 3: Kev Txuas Hluav Taws Xob

Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob

Dot Matrix muaj 5 tus lej piv txwv li, VCC - Txhawm rau txuas nrog NodeMCU Vin.

GND - Txhawm rau txuas nrog Ground Pin (GND) ntawm NodeMCU.

Din - Txhawm rau txuas nrog Digital Pin D0 ntawm NodeMCU.

CS - Txhawm rau txuas nrog Digital Pin D1 ntawm NodeMCU.

CLK - Txhawm rau txuas nrog Digital Pin D2 ntawm NodeMCU.

Kauj Ruam 4: Teeb Lub Tsev Qiv Ntawv

Ua ntej koj pib nrog coding koj xav tau Arduino IDE.

Txhawm rau rub tawm Arduino IDE thiab rau NodeMCU teeb tsa, koj tuaj yeem tshawb xyuas kuv cov lus qhia yav dhau los. Thiab rau qhov Qhia Qhia no koj xav tau LedControl Matrix LIbrary, koj tuaj yeem rub nws los ntawm qhov txuas hauv qab no.

LED Tswj Tsev Qiv

Ok, cia peb pib nrog coding

Kauj ruam 5: Source Code

CODE:

#suav nrog

int DIN = 16; // D0 Nws

int CS = 5; // D1 int CLK = 4; // D2 ua

LedControl lc = LedControl (DIN, CLK, CS, 0);

void teeb tsa () {

lc.shutdown (0, tsis tseeb); // MAX72XX nyob rau hauv hom kev txuag hluav taws xob thaum pib lc.setIntensity (0, 15); // Teeb lub teeb ci kom siab tshaj tus nqi lc.clearDisplay (0); // thiab tshem tawm cov zaub}

void voj () {

byte a [8] = {0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF}; // L byte b [8] = {0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, 0xFF, 0xFF}; // Kuv byte c [8] = {0x7F, 0xFF, 0xC0, 0xDF, 0xDF, 0xC3, 0x7F, 0x3F}; // G byte d [8] = {0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0xC3, 0xC3, 0xC3}; // H byte e [8] = {0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}; // T byte f [8] = {0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0xC3, 0xC3, 0xC3}; // H byte g [8] = {0x3C, 0x7E, 0xC3, 0xC3, 0xC3, 0xC3, 0x7E, 0x3C}; // O byte h [8] = {0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF}; // U byte i [8] = {0x7F, 0xFE, 0xC0, 0xFE, 0x7F, 0x03, 0x7F, 0xFE}; // S byte j [8] = {0xFF, 0xFF, 0xC0, 0xF8, 0xF8, 0xC0, 0xFF, 0xFF}; // E printByte (ib); ncua (1000); printByte (b); cov. ncua (1000); printByte (c); cov ncua (1000); printByte (d); cov. ncua (1000); printByte (e); cov. ncua (1000); printByte (f); cov. ncua (1000); printByte (g); cov. ncua (1000); printByte (h); ncua (1000); printByte (kuv); ncua (1000); printByte (j); cov. ncua (1000); }

void printByte (byte cim ) {

int kuv = 0; rau (kuv = 0; kuv <8; kuv ++) {lc.setRow (0, kuv, tus cim )); }}

Rub tus lej "LED_DotMatrix_NodeMCU.ino" txuas hauv qab no.

Koj tuaj yeem tinker nrog cov cai raws li koj xav tau, lossis siv nws zoo li nws yog.

Kauj Ruam 6: NTUJ

Qhov ntawd yog txhua tus tsim

Kuv vam tias koj nyiam qhov no. Nyob twj ywm rau ntau txoj haujlwm!

Pom zoo: