Cov txheej txheem:

Cov Lus Qhia Tshwj Xeeb Chaw Nyob Huab Cua: 5 Kauj Ruam (nrog Duab)
Cov Lus Qhia Tshwj Xeeb Chaw Nyob Huab Cua: 5 Kauj Ruam (nrog Duab)

Video: Cov Lus Qhia Tshwj Xeeb Chaw Nyob Huab Cua: 5 Kauj Ruam (nrog Duab)

Video: Cov Lus Qhia Tshwj Xeeb Chaw Nyob Huab Cua: 5 Kauj Ruam (nrog Duab)
Video: maiv npib lau lau lawm 2024, Kaum ib hlis
Anonim
Image
Image

Hav Guys! Rau qhov haujlwm no lub hlis Kuv tau ua lub chaw nres tsheb huab cua nyob rau hauv daim ntawv ntawm Desk Plant lossis koj tuaj yeem hu nws ua Desk Showpiece. Qhov chaw nres tsheb huab cua no nqa cov ntaub ntawv mus rau ESP8266 los ntawm Lub Vev Xaib npe hu ua openwethermap.org thiab hloov cov xim RGB hauv qhov ua yeeb yam. Cov yeeb yam tau txais ntau yam xim sib txawv ua ke, lawv hloov pauv raws Lub Sijhawm thiab Kev Nyab Xeeb. Piv txwv li yog tias nws los nag sab nraum lub sijhawm yav tsaus ntuj ces cov xim huab sib txuam ua xim liab, txiv kab ntxwv, daj thiab nws qhia tau tias muaj cua daj cua dub zoo li no. Zoo li qhov no nws muaj ntau yam xim sib xyaw ua ke.

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam

*Node MCU (ESP8266)

*WS2812 LED Sawb

*5v Micro USB them nyiaj

*Cov ntawv luam tawm 3D

Kauj Ruam 2: 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

*Ua cov kev sib txuas raws li qhia hauv daim duab qhia chaw.

*Koj tuaj yeem siv WS2812B LED Sawb hloov tus kheej LEDs.

*Cov ntaub ntawv tus pin txuas nrog tus pin D4 ntawm ESP8266, GND rau GND thiab 5v rau Vin ntawm NodeMCU.

*Nco ntsoov tias koj siv 4 LEDs rau txhua phab ntsa (4 LEDs x 4 phab ntsa = 16 LEDs), 7 LEDs rau huab thiab 2 LEDs rau Tshav/Hli (3D luam ntawv me me Circe).

*ESP8266 pawg thawj coj tau muab tso rau hauv qab lub hauv paus, lub hauv paus muaj cov ntawv luam tawm 3D los npog nws.

Kauj Ruam 3: Cog

Cog
Cog

*Muab lub polythene npog rau hauv lub lauj kaub.

*Muab cov av thiab tso rau hauv lub thawv zoo li lub lauj kaub.

Kauj ruam 4: Coding

Coding
Coding
Coding
Coding
Coding
Coding
Coding
Coding

*Qhib cov cai hauv qab no hauv Arduino IDE.

*Code:

*Nco ntsoov tias koj tau suav nrog txhua lub tsev qiv ntawv uas tau hais hauv txoj cai.

*Tam sim no koj yuav tsum kho qhov no

Txoj hlua OPEN_WEATHER_MAP_APP_ID = "App_ID"; Txoj hlua OPEN_WEATHER_MAP_LOCATION_ID = "Location_ID";

*Qhib qhov browser thiab tshawb rau www.openweathermap.org.

*Tsim tus as khauj thiab nkag mus rau hauv lub vev xaib ntawd.

*Nyem rau ntawm API tus yuam sij theej cov lej thiab muab tshuaj txhuam tso rau hauv qhov program ntawm APP_ID.

*Hauv tib lub vev xaib tshawb nrhiav koj qhov chaw qhib qhov tshwm sim thiab luam tus lej kawg ntawm URL thiab muab tshuaj txhuam rau ntawm LOCATION_ID.

*MAP_ID thiab LOCATION_ID yuav zoo ib yam li kuv.

*Sau koj lub Wifi_name ntawm ssid thiab koj tus password Wifi.

const char* ssid = "Wifi_name"; const char* password = "password";

*Tam sim no hloov Lub Sijhawm raws li koj lub tebchaws Lub Sijhawm Sijhawm

int sij hawm = 5.5 * 3600;

Raws li Is Nrias teb Lub Sijhawm yog 5:30 yog li kuv tau ntaus 5.5 zoo ib yam koj tuaj yeem ntaus koj Lub Sijhawm.

*Txhua kab hauv qab yuav tsum tau kho los ntawm koj raws li kuv tau qhia.

*Tam sim no txuas ESP8266 rau koj lub PC, xaiv qhov chaw nres nkoj thiab xa cov cai.

Kauj ruam 5: Kawg

Kawg
Kawg

Txuas lub Micro USB charger thiab koj ua tiav.

Ua Tsaug!

Pom zoo: