Cov txheej txheem:

Ua Haujlwm Los Ntawm Lub Tsev Qhov Ntsuas Qhov Ntsuas: 5 Kauj Ruam
Ua Haujlwm Los Ntawm Lub Tsev Qhov Ntsuas Qhov Ntsuas: 5 Kauj Ruam

Video: Ua Haujlwm Los Ntawm Lub Tsev Qhov Ntsuas Qhov Ntsuas: 5 Kauj Ruam

Video: Ua Haujlwm Los Ntawm Lub Tsev Qhov Ntsuas Qhov Ntsuas: 5 Kauj Ruam
Video: UA KAWG PEEV XWM -May maylee [official] New Song/MV/VDO 2024, Kaum ib hlis
Anonim
Image
Image
Sau tag nrho cov ntaub ntawv xav tau
Sau tag nrho cov ntaub ntawv xav tau

Nrog rau qhov xwm txheej tam sim no ntawm kev ua haujlwm hauv tsev, Kuv tab tom ntsib qee qhov kev nyuaj vim tias kuv cov menyuam tseem kawm hauv tsev.

Qee zaum kev ua haujlwm thiab tsev neeg lub neej tuaj yeem ua rau me ntsis. Yog li kuv yuav tsum tuaj yeem teeb tsa qee txoj cai hauv av nrog kuv cov menyuam kom paub tseeb tias lawv paub tias kuv puas muaj lossis nyob hauv lub xeev ntws nrog kev mloog zoo.

Kuv muaj ib qho qub LED Sawb, thiab ESP8266 los ntawm txoj haujlwm yav dhau los, yog li vim li cas ho tsis tsim qhov ntsuas tsis xwm txheej qhia rau kuv tsev neeg paub tias tam sim no kuv tsis khoom los tsis ua.

Yog li ntawm no yog cov cai hauv av:

- Liab: Txiv tsis khoom, yog li tsis txhob cuam tshuam thiab ua rau lub suab nrov qis

- Ntsuab: Txiv muaj kev cuam tshuam

- Xiav: Txiv ua haujlwm, tab sis tuaj yeem muaj yog xav tau

Kuv vam tias koj txaus siab rau cov ntawv no thiab muaj kev lom zem me ntsis nrog cov menyuam.

Kauj Ruam 1: Sau tag nrho cov ntaub ntawv xav tau

Sau tag nrho cov ntaub ntawv xav tau
Sau tag nrho cov ntaub ntawv xav tau

Lub voj voog no yooj yim heev, peb tsis xav tau cov ntaub ntawv ntau:

SIB 8266

- 5 V addressable LED Sawb (WS2812B)

-330 ohm resistor

- Pawg thawj coj

- Txuas Hlau

- Diffuser (Kuv siv lub raj mis mis rau lub hom phiaj no)

Thov nco ntsoov tias qhov txuas saum toj no yog cov koom nrog koom nrog

Kauj ruam 2: Tsim Circuit Court

Tsim Circuit Court
Tsim Circuit Court

Lub Circuit Court yog qhov yooj yim heev li koj pom. Kuv siv 5V LED sawb. Vim tias ESP8266 ua haujlwm ntawm 3.3V, Kuv yuav tsum tau muab qhov txwv tam sim no resistor 330 Ohm, txhawm rau txuas D2 rau Din ntawm LED Sawb.

Cov hlua LED tuaj yeem siv tau los ntawm Vin uas yog 5V. Kuv tau siv kuv lub ESP8266 lub rooj tsavxwm los ntawm USB chaw nres nkoj ntawm PC.

ESP8266 ua raws li lub qhov rooj nkag mus rau internet. Nws yuav txuas rau WiFi thiab tos rau kev qhia.

Kauj Ruam 3: Thauj Txoj Cai

Thauj cov Code
Thauj cov Code
Thauj cov Code
Thauj cov Code

Cov peev txheej tag nrho tuaj yeem rub tawm los ntawm qhov txuas no.

Koj yuav tsum tau hloov cov ntu hauv qab no kom haum koj li WiFi teeb tsa.

/* Network nqis*/const char* ssid = "yourssid"; // SSID - koj lub WiFi lub npe const char* password = "yourssidpassword"; // Lo lus zais

Thaum qhov ntawd ua tiav, koj tuaj yeem sau cov cai thiab xa nws mus rau ESP8266.

Koj yuav xav hloov kho tus IP chaw ib yam yog tias koj xav tias nws yuav sib tsoo nrog cov cuab yeej tam sim no uas nyob hauv koj lub subnet.

Tus IP chaw nyob IP (192, 168, 1, 111); // IP chaw nyob zoo li qub ntawm ntaus IPAddress rooj vag (192, 168, 1, 1); // Gatway IPAddress subnet (255, 255, 255, 0); // Network npog

thiab ntu hauv qab no ntawm cov cai hauv ntu SETUP

teeb tsa tsis muaj dab tsi (tsis muaj dab tsi) {ncua (1000); / * Pib qee yam (tsis) yam tseem ceeb */ Serial.begin (115200); WiFi.begin (ssid, password); WiFi.config (ip, rooj vag, subnet); // hais tawm qhov no rau DHCP

Koj tuaj yeem tshem tawm cov cai kom tag li ntawd nws yuav raug txiav siv DHCP.

Kauj Ruam 4: Qhib Lub Teeb

Qhib Lub Teeb
Qhib Lub Teeb
Qhib Lub Teeb
Qhib Lub Teeb
Qhib Lub Teeb
Qhib Lub Teeb
Qhib Lub Teeb
Qhib Lub Teeb

Yog tias txhua yam mus tau zoo, koj yuav tsum muaj peev xwm taw tes koj lub browser mus rau IP chaw nyob uas tau teeb tsa yav dhau los:

Koj tuaj yeem nyem rau ntawm ib qho xim ua ke uas koj nyiam.

Qee lub sij hawm kuv tsis nco qab teeb tsa kuv li xwm txheej thaum kuv hu xov tooj thaum ua haujlwm los ntawm sijhawm nyob hauv tsev. Thiab kuv cov menyuam tau teeb tsa nws rau kuv kom pom kuv qhov xwm txheej raug.

Kuv vam tias txoj haujlwm no coj kev lom zem rau kev ua haujlwm los ntawm lub neej hauv tsev peb txhua tus nyob rau lub sijhawm no.

Yog tias koj nyiam cov ntawv tshaj tawm no, koj tseem tuaj yeem tshawb xyuas kuv lub vev xaib rau lwm cov phiaj xwm cuam tshuam nrog Arduino.

Qhov no yog qhov hloov kho tshiab uas tso cai rau koj txuas nws mus rau MQTT, yog li koj tuaj yeem tswj lub teeb los ntawm internet.

Pom zoo: