Cov txheej txheem:

Yuav Ua Li Cas Tswj LED Siv ESP8266 NodemCU Lua WiFi Los Ntawm Lub Vev Xaib: 7 Kauj Ruam
Yuav Ua Li Cas Tswj LED Siv ESP8266 NodemCU Lua WiFi Los Ntawm Lub Vev Xaib: 7 Kauj Ruam

Video: Yuav Ua Li Cas Tswj LED Siv ESP8266 NodemCU Lua WiFi Los Ntawm Lub Vev Xaib: 7 Kauj Ruam

Video: Yuav Ua Li Cas Tswj LED Siv ESP8266 NodemCU Lua WiFi Los Ntawm Lub Vev Xaib: 7 Kauj Ruam
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Tswj LED Siv ESP8266 NodemCU Lua WiFi Los Ntawm Lub Vev Xaib
Yuav Ua Li Cas Tswj LED Siv ESP8266 NodemCU Lua WiFi Los Ntawm Lub Vev Xaib

Phau ntawv qhia no yuav qhia koj qee qhov pib ntawm kev siv ESP8266 NodemCU Lua WiFi los tswj LED los ntawm lub vev xaib.

Ua ntej koj yuav pib, xyuas kom koj muaj tag nrho cov ntaub ntawv xav tau:

  1. ESP8266 NodeMCU Lua WiFi
  2. LED
  3. Cov qhob cij
  4. Jumper (yog xav tau)
  5. Micro USB

Kauj Ruam 1: Tus Kheej Txhais

Pin Txhais
Pin Txhais

Kauj ruam 2: Tus Pin Txuas

Tus Pin Txuas
Tus Pin Txuas

Qhov no yog ib qho ntawm kev txuas yooj yim tshaj plaws thiab haum rau tus pib hauv qhov kev qhia no, peb xav tau txuas LED lub anode rau ESP8266's GND tus pin thiab LED lub cathode rau ESP8266 D7.

Kauj ruam 3: PHP & JSON Source Code

Rub tawm cov peev txheej no thiab xa mus rau Arduino.

Kauj Ruam 4: Tsim Lub Vev Xaib

1. Ua ntej, mus rau ntawm no.

2. Pub dawb tso npe rau tus as khauj thiab ua lub vev xaib npe. (Tsuas yog sau lub npe nkaus xwb tsis xav tau www thiab.com)

3. Yog tias sau npe tus account ua tiav, qhib email rau kev txheeb xyuas.

4. Tom qab ua tiav, mus rau kev tswj hwm lub vev xaib thiab xa cov ntaub ntawv PHP thiab JSON.

Kauj ruam 5: Arduino Source Code

Rub tawm qhov chaws thiab qhib nws nrog Arduino IDE. Nco ntsoov tias koj tau ua tiav teeb tsa ESP8266 rau hauv koj Arduino IDE yog li koj tuaj yeem txuas koj li ESP8266 rau hauv koj Arduino IDE thiab xaiv lub rooj tsav xwm raug thiab chaw nres nkoj rau hauv Arduino IDE.

Nyem rau qhov no txhawm rau teeb tsa ESP8266 rau hauv koj li Arduino IDE.

*Nco tseg:

1. Hloov ssid thiab password rau koj tus kheej WiFi Lub Npe thiab tus password

2. Hloov tus tswv tsev thiab txoj hauv kev

const char* tus tswv = "controlled.000webhostapp.com"; // koj sau

Txoj hlua txoj kab = "/light.json"; // pib nrog slash

3. Hloov tus lej tus lej

Kauj Ruam 6: Qhov tshwm sim

Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim

Tom qab fais fab tswj tus tswj, qhib "Serial Monitor" thiab nws yuav qhia:

… Txuas WIFI

txuas mus rau (Koj lub vev xaib npe)

…………… LED Tawm

kaw kev sib txuas. Txuas mus rau (Koj lub vev xaib npe)

Thaum koj qhib koj lub vev xaib thiab nyem "Qhib" khawm, "Serial Monitor" yuav qhia:

…………… LED rau

kaw kev sib txuas. Txuas mus rau (Koj lub vev xaib npe)

LOSSIS nyem "Tua Tawm" khawm, "Serial Monitor" yuav qhia:

…………… LED OFFclosing kev twb kev txuas. Txuas rau (Koj lub vev xaib npe)

Kauj ruam 7: Yees duab

Cov vis dis aus no qhia txog qhov ua piv txwv ntawm kev tswj LED siv ESP8266 los ntawm lub vev xaib.

Pom zoo: