Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Teeb Arduino IDE rau Esp8266 Kev Txhim Kho
- Kauj ruam 2: Rub tawm Cov Tsev Qiv Ntawv Sab Nraud
- Kauj Ruam 3: Sau Ib co Cai Tam Sim No
- Kauj Ruam 4: Daim duab Circuit Court
- Kauj ruam 5: Upload Code rau Esp8266
- Kauj Ruam 6: Xeem Txhua Yam
Video: MAX7219 LED Matrix MQTT Siv Esp8266: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Kuv tau sim txuas kuv MAX7219 LED zaub rau MQTT server thiab tau txais cov ntawv los ntawm MQTT kev tso npe kom pom.
tab sis kuv tsis tau txais cov cai tsim nyog hauv is taws nem, yog li kuv pib tsim kuv tus kheej …
thiab qhov tshwm sim los zoo heev …
- koj tuaj yeem tso saib cov ntawv ntawm cov zaub coj
- koj tuaj yeem kho qhov siv ntawm cov zaub
- koj tuaj yeem teeb tsa qhov nrawm
Khoom siv
- ESP8266 pawg thawj coj loj. (kuv rooj plaub nws yog NODE MCU v1.0)
- MAX7219 LED Matrix Zaub.
Software xav tau:
- Arduino IDE Cov.
- MQTT neeg rau zaub mov. (kuv kis Mosquitto)
Tsev qiv ntawv yuav tsum tau:
- ESP8266WiFi.h
- MD_MAX72xx.h
- EspMQTTClient.h
Kauj Ruam 1: Teeb Arduino IDE rau Esp8266 Kev Txhim Kho
qhib kev nyiam ntawm Arduino tom qab ntawd muab tshuaj txhuam URL hauv qab no hauv Aditional Boards Manager URLs:
arduino.esp8266.com/stable/package_esp8266com_index.json
ces Cov Cuab Yeej> Boards> Tus Thawj Saib Xyuas Pawg thiab tshawb rau esp8266 thiab nruab nws.
tam sim no koj Arduino lub tswv yim npaj rau esp8266 kev txhim kho.
Kauj ruam 2: Rub tawm Cov Tsev Qiv Ntawv Sab Nraud
tam sim no peb xav tau qee lub tsev qiv ntawv rau MAX7219 thiab MQTT Client.
cia peb rub tawm thiab teeb tsa cov tsev qiv ntawv
mus rau Sketch> suav nrog Tsev Qiv Ntawv> Tswj Tsev Qiv Ntawv ntawm Arduino IDE
thiab tshawb rau EspMQTTClient thiab nyem Nruab
NB: Txhim kho txhua lub tsev qiv ntawv nyob, nws yog qhov tseem ceeb
Rov tshawb nrhiav MD_MAX72xx thiab nyem Nruab
Kauj Ruam 3: Sau Ib co Cai Tam Sim No
Tam sim no muab tshuaj txhuam hauv qab no
#suav nrog
#include #include #include "EspMQTTClient.h" #define MAX_DEVICES 4 // koj ntaus ntawv suav #define CLK_PIN D5 // lossis SCK #define DATA_PIN D7 // lossis MOSI #define CS_PIN D4 // lossis SS // koj tuaj yeem teeb nws rau ib tus pin #define HARDWARE_TYPE MD_MAX72XX:: PAROLA_HW // hloov pauv raws li koj hom zaub MD_MAX72XX mx = MD_MAX72XX (HARDWARE_TYPE, CS_PIN, MAX_DEVICES); const uint8_t MESG_SIZE = 255; const uint8_t CHAR_SPACING = 1; uint8_t SCROLL_DELAY = 75; // default scroll delay uint8_t INTENSITY = 5; // default siv char curMessage [MESG_SIZE]; char newMessage [MESG_SIZE]; bool newMessageAvailable = tsis tseeb; void scrollDataSink (uint8_t dev, MD_MAX72XX:: transformType_t t, uint8_t col) {} uint8_t scrollDataSource (uint8_t dev, MD_MAX72XX:: transformType_t t) {zoo li qub enum {S_IDLE, S_NEXT_CHAR, S_SHOW_SHOW, S_SHOW_SHOW, S_SHOW_SATA_SHOW, zoo li qub char *p; zoo li qub uint16_t curLen, showLen; zoo li qub uint8_t cBuf [8]; uint8_t colData = 0; hloov (xeev) {rooj plaub S_IDLE: p = curMessage; yog (newMessageAvailable) {strcpy (curMessage, newMessage); newMessageAvailable = tsis tseeb; } xeev = S_NEXT_CHAR; tawg; case S_NEXT_CHAR: yog (*p == '\ 0') xeev = S_IDLE; lwm tus {showLen = mx.getChar (*p ++, sizeof (cBuf) / sizeof (cBuf [0]), cBuf); curLen = 0; xeev = S_SHOW_CHAR; } tawg; case S_SHOW_CHAR: colData = cBuf [curLen ++]; yog (curLen = SCROLL_DELAY) {mx.transform (MD_MAX72XX:: TSL); // nqes nrog - qhov kev hu rov qab yuav thauj tag nrho cov ntaub ntawv prevTime = millis (); // pib taw tes rau lub sijhawm tom ntej}} tsis muaj teeb meem teeb tsa () {Serial.begin (115200)); mx.begin (); mx.control (MD_MAX72XX:: INTENSITY, INTENSITY); mx.setShiftDataInCallback (scrollDataSource); mx.setShiftDataOutCallback (scrollDataSink); curMessage [0] = newMessage [0] = '\ 0'; sprintf (curMessage, "Smart Display"); } void onConnectionEstablished () {// MQTT lub npe sau npe rau cov ntawv nyeem cov neeg siv khoom.subscribe ("leddisplay/text", (const String & payload) {sprintf (curMessage, payload.c_str ());});
// MQTT cov ncauj lus sau npe rau tso saib qhov kev tswj hwm
client.subscribe ("leddisplay/siv", (const String & payload) {mx.control (MD_MAX72XX:: INTENSITY, payload.toInt ());}); // MQTT kev sau npe lub ntsiab lus rau cov zaub scroll nrawm tswj client.subscribe ("leddisplay/scroll", (const String & payload) {SCROLL_DELAY = payload.toInt ();}); } tsis muaj dab tsi voj () {client.loop (); scrollText (); }
Yog xav paub ntxiv, xa mus rau qhov chaw cia khoom no
github.com/souravj96/max7219-mqtt-esp8266
Kauj Ruam 4: Daim duab Circuit Court
txuas MAX7219 zaub nrog NODE MCU
Kauj ruam 5: Upload Code rau Esp8266
tam sim no xaiv koj hom board raug thiab qhov chaw nres nkoj txuas tom qab ntawd nyem upload.
Kauj Ruam 6: Xeem Txhua Yam
yog tias txhua yam mus tau zoo ces koj esp8266 yuav txuas nrog koj li MQTT server.
tam sim no, yog tias muaj dab tsi yuav tshaj tawm ntawm leddisplay/cov ncauj lus ntsiab lus uas yuav nthuav tawm.
{
ntsiab lus: "leddisplay/text", them: "koj cov lus ntawm no"}
yog tias koj xav teeb tsa qhov siv ntawm cov zaub
{
ntsiab lus: "leddisplay/siv", them nyiaj: "2" // max yog 15 thiab min 0}
yog tias koj xav teeb tsa qhov nrawm ntawm cov zaub
{
ntsiab lus: "leddisplay/scroll", payload: "100" // max yog 255 thiab min 0}
Zoo siab coding
Pom zoo:
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Siv Dua: 6 Cov Kauj Ruam
Cov Hais Lus Ua Los Ntawm Cov Khoom Siv Rov Los thiab Rov Los Siv Rov Los: " Suab paj nruag yog cov lus thoob ntiaj teb ntawm tib neeg. Thiab qhov zoo tshaj plaws-lawv tsis tau them kuv ib dime. Txhua yam nyob rau hauv no pr
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev -- Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: 4 Cov Kauj Ruam
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev || Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: Nov Yog Qhov Tuchless Hloov Rau Cov Khoom Siv Hauv Tsev. Koj Siv Tau Qhov No Mus Rau Txhua Qhov Chaw Hauv Pej Xeem Kom Pab Tau Tawm Tsam Ib Yam Kab Mob. Lub Circuit Court Raws Li Tsaus Sensor Circuit Ua Los Ntawm Op-Amp Thiab LDR. Qhov Tseem Ceeb Thib Ob Ntawm Qhov Circuit Court SR Flip-Flop Nrog Sequencell
Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219: 4 Cov Kauj Ruam
Arduino: Qhov Ntsuas Pom Zoo Siv Led Matrix MAX7219: Hauv qhov kev qhia yav dhau los Kuv tau ua lub zog ntsuas qhov ntsuas siv lub nplhaib RGB neo pixels coj. koj tuaj yeem pom nws hauv kab lus no " Potentio Qhov Ntsuas Siv RGB Neopixel " Thiab hnub no kuv yuav qhia lub hwj chim ntsuas ntsuas siv MAX7219 coj mus ntsib
Txawb Xov Tooj Siv Yooj Yim Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: 14 Cov Kauj Ruam (nrog Duab)
Kev Siv Xov Tooj Ntawm Lub Xov Tooj Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: Koj puas tau xav tsim qhov kev ua kom txias txias? Yog tias yog, ua li cas txog kev tsim ib qho ntawm cov neeg nyiam tshaj plaws thiab txhua tus nyiam cov khoom siv xws li Lub Xov Tooj Txawb !!!. Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav tsim lub xov tooj txawb yooj yim siv STM li cas
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Cov Khoom Siv: 3 Cov Kauj Ruam (nrog Duab)
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Siv Cov Khoom Siv: Lub teeb pom kev zoo los ntawm lub Windows PC dhau Bluetooth thiab LED cov txheej txheem nthuav tawm Ib co piv txwv ntawm pixel kos duab thiab cov duab ua haujlwm khiav ntawm LED Cov Ntsiab Lus ntawm PIXEL Guts Kit Hauv Cov Lus Qhia no, peb ' yuav