Cov txheej txheem:

Chaw nres tsheb huab cua Blynk: 7 Kauj Ruam
Chaw nres tsheb huab cua Blynk: 7 Kauj Ruam

Video: Chaw nres tsheb huab cua Blynk: 7 Kauj Ruam

Video: Chaw nres tsheb huab cua Blynk: 7 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Blynk Huab Cua Chaw Nres Tsheb
Blynk Huab Cua Chaw Nres Tsheb

Tau txais huab cua hloov tshiab ncaj qha rau koj lub xov tooj ntawm tes los ntawm koj tus kheej lub chaw nres tsheb huab cua! Ua rau xav tsis thoob sai & yooj yim tsim nrog xChips.

Kauj Ruam 1: Yam Khoom Siv Hauv Txoj Haujlwm no

Cov khoom siv kho vajtse

  • XinaBox CW01 x 1
  • XinaBox SW01 x 1
  • XinaBox SL01 x 1
  • XinaBox OD01 x 1
  • XinaBox IP01 x 1
  • XinaBox XC10 x 1

Software apps thiab cov kev pabcuam online

  • Arduino IDE Cov
  • Blynk

Kauj ruam 2: Zaj dab neeg

Taw qhia

Kuv tsim txoj haujlwm no siv XinaBox xChips thiab Arduino IDE. Nws yog txoj haujlwm 5 feeb, uas tso cai rau koj kom tau txais cov ntaub ntawv huab cua ntawm koj lub xov tooj ntawm Blynk app thiab ntawm OLED screen ntawm OD01. Txoj haujlwm no muaj txiaj ntsig zoo vim tias koj tuaj yeem saib xyuas huab cua nyob txhua qhov chaw koj xaiv thiab tau txais kev hloov tshiab ncaj qha ntawm koj lub xov tooj ntawm lub app. Kuv tau xaiv los siv xChips vim tias lawv yog tus phooj ywg siv, lawv kuj tseem tshem tawm qhov xav tau ntawm kev siv cov laug thiab cov tsim hluav taws xob loj. Siv Arduino IDE Kuv tuaj yeem ua haujlwm yooj yim xChips.

Kauj ruam 3: Rub tawm Cov Tsev Qiv Ntawv

  • Mus rau Github.xinabox
  • Rub tawm xCore ZIP
  • Nruab nws rau hauv Arduino IDE los ntawm kev mus rau "Sketch", "Xws li Lub Tsev Qiv Ntawv", tom qab ntawd "Ntxiv. ZIP Library". Raws li pom hauv qab no

Daim duab 1: Ntxiv ZIP cov tsev qiv ntawv

  • Rub tawm xSW01 ZIP
  • Ntxiv cov tsev qiv ntawv ib yam li koj tau ua rau xCore.
  • Rov ua dua rau xSL01 thiab xOD01
  • Koj kuj xav tau nruab Blynk lub tsev qiv ntawv yog li koj tuaj yeem siv lub app. Koj tuaj yeem pom nws ntawm no
  • Ua ntej koj tuaj yeem program koj xav tau kom ntseeg tau tias koj tau siv lub rooj tsav xwm raug. Hauv qhov haujlwm no kuv siv Generic ESP8266 uas yog nyob hauv CW01 xChip. Koj tuaj yeem rub tawm lub tsev qiv ntawv board ntawm no.

Kauj ruam 4: Programming

Txuas IP01, CW01, SW01, SL01 thiab OD01 siv xBUS Connectors. Nco ntsoov tias xChips cov npe raug taw qhia kom raug

Daim duab 2: Txuas xChips

  • Tam sim no ntxig IP01 thiab txuas xChips rau hauv USB chaw nres nkoj muaj.
  • Rub tawm lossis luam thiab muab tshuaj txhuam tus lej los ntawm "CODE" mus rau hauv koj li Arduino IDE. Nkag mus rau koj daim ntawv lees paub, WiFi lub npe thiab tus password uas qhia.
  • Xwb, koj tuaj yeem tsim koj tus kheej cov cai siv cov hauv paus ntsiab lus kom ua tiav tib lub hom phiaj
  • Kom ntseeg tau tias tsis muaj qhov yuam kev sau cov cai.

Kauj ruam 5: Blynk Teeb

  • Tom qab teeb tsa Blynk app dawb los ntawm koj lub khw app nws yog lub sijhawm los ua Qhov Teeb Meem.
  • Ua ntej nyem "Nkag Mus Hauv" tom qab nkag mus rau koj tus email chaw nyob thiab tus lej nkag mus kom ntseeg tau tias koj "Server Settings" tau teeb tsa rau "BLYNK".

Daim duab 3: Chaw Teeb Meem

  • ID nkag mus
  • Tsim Txoj Haujlwm Tshiab.
  • Xaiv lub cuab yeej "ESP8266"

Daim duab 4: Xaiv lub cuab yeej/pawg thawj coj saib

  • Muab lub npe project
  • Tau txais "Auth Token" ceeb toom thiab email uas muaj "Auth Token".

Daim duab 5: Auth Token ceeb toom

Mus rau "Widget Box"

Daim duab 6: Widget Box

  • Ntxiv 4 "Khawm" thiab 4 "Tus Nqi Qhia"
  • Muab cov "khawm" thiab "Tus Nqi Qhia" lawv Cov Pins Virtual raws li tau hais tseg hauv "CODE". Kuv siv tus lej txawm tias "Nyees khawm" thiab sib txawv tus lej rau "Tus Nqi Qhia"
  • Qhov teeb tsa no tuaj yeem hloov kho kom haum rau koj cov kev xav tau thaum koj kho koj cov cai.

Daim duab 7: Project Dashboard (Tsis lees paub: Tsis quav ntsej qhov txiaj ntsig no yog lub vijtsam tom qab kuv sim lub chaw nres tsheb huab cua. Koj li yuav tsum zoo ib yam, tsuas yog nrog lub ntsej muag tsis zoo li V7)

Kauj Ruam 6: Tshaj Tawm Txoj Cai

  • Tom qab ua tiav kev suav sau hauv Kauj Ruam 2 (tsis pom qhov yuam kev) koj tuaj yeem xa cov cai rau koj li xChips. Xyuas kom cov hloov pauv tau ntsib "B" thiab "DCE" feem ua ntej xa tawm.
  • Thaum qhov upload tiav, qhib Blynk app ntawm koj lub xov tooj ntawm tes.
  • Qhib koj qhov haujlwm los ntawm Kauj Ruam 3.

Daim duab 8

  • Nias ua si thiab nias qhov "khawm" kom cov ntaub ntawv tuaj yeem pom hauv koj li app thiab ntawm lub vijtsam OLED.
  • Tam sim no koj lub chaw nres tsheb huab cua Blynk tau npaj mus!

Kauj ruam 7: Code

Blynk_Weather_Station.ino Arduino Arduino code rau Weather Station nrog Blynk thiab xCHIPS. Txoj cai no tso cai rau koj kom tswj tau lub chaw nres tsheb huab cua los ntawm koj lub xov tooj ntawm tes thiab tau txais cov ntaub ntawv huab cua hloov tshiab ncaj qha rau koj lub xov tooj ntawm tes los ntawm xCHIP chaw nres tsheb huab cua

#suav nrog // suav nrog cov tsev qiv ntawv tseem ceeb

#suav nrog // suav nrog lub tsev qiv ntawv huab cua huab cua #suav nrog // suav nrog lub teeb pom lub tsev qiv ntawv #suav nrog // suav nrog ESP8266 lub tsev qiv ntawv rau WiFi #suav nrog // suav nrog Blynk lub tsev qiv ntawv rau siv nrog ESP8266 #suav nrog // suav nrog OLED libraryxSW01 SW01; // xSL01 SL01; ntab TempC; ntab dej noo; ntab UVA; ntab UV_Index; // authentication token uas tau xa email rau koj // theej thiab muab cov cim cim ntawm ob nqe lus char char auth = "koj daim ntawv pov thawj auth"; // koj li wifi daim ntawv pov thawj char WIFI_SSID = "koj lub npe WiFi"; // sau koj lub npe wifi nruab nrab ntawm ob nqe lus sib tham char WIFI_PASS = "koj li WiFi password"; // nkag mus rau koj tus password wifi ntawm ob nqe lus BlynkTimer timer; // VirtualPin rau Kub BLYNK_WRITE (V2) {int pinValue = param.asInt (); // muab tus nqi nkag los ntawm tus pin V1 mus rau qhov sib txawv yog (pinValue == 1) {Blynk.virtualWrite (V1, TempC); OD01.println ("Temp_C:"); OD01.println (TempC); } lwm qhov {}} // VirtualPin rau Vaum BLYNK_WRITE (V4) {int pin_value = param.asInt (); // muab tus nqi nkag los ntawm tus pin V3 rau qhov sib txawv yog (pin_value == 1) {Blynk.virtualWrite (V3, Vaum); OD01.println ("Vaum:"); OD01.println (Vaum); } lwm {}} // VirtualPin rau UVA BLYNK_WRITE (V6) {int pinvalue = param.asInt (); // muab tus nqi nkag los ntawm tus pin V5 mus rau qhov sib txawv yog (pinvalue == 1) {Blynk.virtualWrite (V5, UVA); OD01.println ("UVA:"); OD01.println (UVA); } lwm {}} // VirtualPin rau UV_Index BLYNK_WRITE (V8) {int pin_Value = param.asInt (); // muab tus nqi nkag los ntawm tus pin V7 mus rau qhov sib txawv yog (pin_Value == 1) {Blynk.virtualWrite (V7, UV_Index); OD01.println ("UV_Index:"); OD01.println (UV_Index); } lwm {}} tsis muaj teeb meem teeb tsa () {// Debug console TempC = 0; Serial.begin (115200); Hlau.begin (2, 14); SW01.begin (); OLED.begin (); SL01.begin (); Blynk.begin (auth, WIFI_SSID, WIFI_PASS); ncua (2000); } tsis muaj dab tsi voj () {SW01.poll (); TempC = SW01.getTempC (); Vaum = SW01.getHumidity (); SL01.poll (); UVA = SL01.getUVA (); UV_Index = SL01.getUV Index (); Blynk.run (); }

Pom zoo: