Orodha ya maudhui:

Live Covid19 Tracker Kutumia ESP8266 na OLED - Dashibodi ya wakati halisi ya Covid19: Hatua 4
Live Covid19 Tracker Kutumia ESP8266 na OLED - Dashibodi ya wakati halisi ya Covid19: Hatua 4

Video: Live Covid19 Tracker Kutumia ESP8266 na OLED - Dashibodi ya wakati halisi ya Covid19: Hatua 4

Video: Live Covid19 Tracker Kutumia ESP8266 na OLED - Dashibodi ya wakati halisi ya Covid19: Hatua 4
Video: How to check your blood sugar 2024, Desemba
Anonim
Image
Image

Tembelea Tovuti ya Techtronic Harsh:

Kila mahali kuna mlipuko mkubwa wa Novel Corona Virus (COVID19). Ikawa lazima kuweka angalizo kwenye hali ya sasa ya COVID-19 Ulimwenguni.

Kwa hivyo, nikiwa nyumbani, huu ndio mradi niliofikiria "Dashibodi ya Moja kwa Moja ya Dunia ya Covid19" - Dashibodi ambayo hutoa sasisho za wakati halisi juu ya hali ya ulimwengu ya COVID-19. Hakuna haja zaidi ya kuweka TV au kuendelea kutazama kwenye wavuti anuwai.

Ubunifu wa mradi huo haukuwa sehemu muhimu. Lakini kutengeneza kitu muhimu, kutumia vifaa ambavyo vilikuwa rahisi ilikuwa changamoto. Mradi huu hakika utakusaidia kujenga kiolesura rahisi cha dashibodi ili kukuhabarisha.

Vifaa

  • ESP8266
  • OLED Onyesho
  • Chuma za Jumper

Hatua ya 1: Skematiki:

Kuweka mipangilio
Kuweka mipangilio

Hatua ya 2: Kuanzisha:

Kuweka mipangilio
Kuweka mipangilio
Kuweka mipangilio
Kuweka mipangilio
  1. Tembelea Tovuti ya Dashibodi ya Realtime Covid19. Hapa ninatumia
  2. Ingia / Ingia hadi https://thingspeak.com. Nenda kwenye App na Unda Kitendo kipya cha ThingHttp.

    • Toa Jina la Chaguo Lako, URL (https://trackcorona.live), Njia kama GET na katika Kamba ya Parse, unahitaji kubandika XPath kutoka kwa wavuti ya trackcorna.live ya uwanja unaohitajika kuonyesha.
    • Katika Mfano Juu (Picha), mimi ni Mstari wa Kesi kwa Kesi Zilizothibitishwa, unachohitaji kufanya ni

      • Bonyeza kulia kwenye Idadi ya Kesi Zilizothibitishwa> Kagua,
      • Tena Bonyeza kulia kwenye Nambari> Nakili> CopyXPath
      • Bandika hii katika uwanja wa Kamba ya Parse ya Hatua ya ThinkHttp na Uihifadhi.
      • Vivyo hivyo, fanya hivi kwa Wote waliopona, Kifo, Kiwango cha Vifo na Kiwango cha Kifo.
      • Tembelea Nambari ya Chanzo na Badilisha SSID na Jina lako la Wifi, Nenosiri na Nenosiri lako la Wifi na ufunguo wa API na ThingHttp API yako.
  3. Pakia Msimbo. Ni hayo tu !!

Hatua ya 3: Nambari ya Chanzo:

/ * © Ukali wa Kiufundi

Youtube:

Maagizo: https://www.instructables.com/member/… Instagram: https://instagram.com/techtronicharsh Tovuti: https://techtronicharsh.com Telegram:

*/

#jumuisha pamoja // Tumia kazi za ESP8266 # pamoja na #jumuisha # pamoja na # pamoja #

Maonyesho ya Adafruit_SSD1306 = Adafruit_SSD1306 (128, 32, & Wire);

const char * ssid = "*******"; // Router yako SSID yaani Jina la WiFi const char * password = "*******"; // Nenosiri lako la WiFi const char * host = "api.thingspeak.com"; // Tunasoma data kutoka kwa mwenyeji huyu const int httpPortRead = 80; / * Badilisha tu Kitufe cha API na API Yako kupitia ThingHttp * / const char * url1 = "/ apps / thinghttp / send_request? Api_key = TGC4KNQ98REOA4JH"; // Imethibitishwa const char * url2 = "/ apps / thinghttp / send_request? Api_key = Y0ALN1QGDTNLLNNM"; // Iliyorejeshwa const char * url3 = "/ apps / thinghttp / send_request? Api_key = 0J24MB3W9F9Q0E7M"; // Kifo const char * url4 = "/ apps / thinghttp / send_request? Api_key = R2BKR1DRVS5YT2PH"; // Kiwango cha kupona const char * url5 = "/ apps / thinghttp / send_request? Api_key = VYMVMGK9S8W21EXQ"; // Kiwango cha Vifo

Kesi za Kamba, Kifo, Kupona, Kupona tena, Kuuawa;

Mteja wa Wateja wa WiFi; // Unda mteja wa WiFi na mteja wa

Mteja wa HTTP

usanidi batili () {

Kuanzia Serial (9600); // Anzisha mawasiliano ya serial WiFi.disconnect (); // Tenganisha na unganisha tena kwa Wifi uliyoweka kuchelewesha (1000); Kuanza kwa WiFi (ssid, password); Serial.println ("Imeunganishwa kwenye mtandao wa WiFi"); // Onyesha maoni juu ya mfuatiliaji wa serial Serial.println (WiFi.localIP ()); onyesha.anza (); onyesha.display (); kuchelewesha (1000);

onyesha wazi Cleplay ();

onyesha.display ();

onyesha.setTextSize (1);

onyesha.setTextColor (NYEUPE);

}

kitanzi batili ()

{// Kusoma 1: Kusoma Kesi Zilizothibitishwa

ikiwa (http. kuanza (mwenyeji, httpPortRead, url1)) // Unganisha kwa mwenyeji na url

{int httpCode = http. GET (); // Angalia maoni ikiwa kuna majibu ikiwa (httpCode> 0) {if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Kesi = http.getString (); Serial.print ("Kesi Zilizothibitishwa:"); Serial.println (Kesi); onyesha.setCursor (0, 0); onyesha.println ("COVID19 LIVE"); onyesha.println (""); display.println ("Kesi Zilizothibitishwa:"); onyesha.println (Kesi); onyesha.display (); kuchelewesha (4000); onyesha wazi Cleplay (); }} mwingine // Ikiwa hatuwezi kupata data {Serial.printf ("[HTTP] GET… imeshindwa, kosa:% s / n", http.errorToString (httpCode).c_str ()); } http.end (); } mwingine // Ikiwa hatuwezi kuungana na HTTP {Serial.printf ("[HTTP} Imeshindwa kuunganisha / n"); }

// Kusoma 2: Usomaji wa Iliyopatikana

ikiwa (http. anza (mwenyeji, httpPortRead, url2))

{int httpCode = http. GET (); ikiwa (httpCode> 0) {ikiwa (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Rejesha = http.getString (); Serial.print ("Imepona:"); Serial.println (Rejesha); onyesha.setCursor (0, 0); onyesha.println ("COVID19 LIVE"); onyesha.println (""); onyesha.println ("Imepatikana:"); onyesha.println (Rejesha); onyesha.display (); kuchelewesha (4000); onyesha wazi Cleplay (); }} mwingine {Serial.printf ("[HTTP] GET… imeshindwa, kosa:% s / n", http.errorToString (httpCode).c_str ()); } http.end (); } mwingine {Serial.printf ("[HTTP} Imeshindwa kuunganisha / n"); }

// Kusoma 3: Kusoma Vifo

ikiwa (http. anza (mwenyeji, httpPortRead, url3))

{int httpCode = http. GET (); ikiwa (httpCode> 0) {ikiwa (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Kifo = http.getString (); Serial.print ("Vifo:"); Serial.println (Kifo); onyesha.setCursor (0, 0); onyesha.println ("COVID19 LIVE"); onyesha.println (""); onyesha.println ("Vifo:"); onyesha.println (Kifo); onyesha.display (); kuchelewesha (4000); onyesha wazi Cleplay (); }} mwingine {Serial.printf ("[HTTP] GET… imeshindwa, kosa:% s / n", http.errorToString (httpCode).c_str ()); } http.end (); } mwingine {Serial.printf ("[HTTP} Imeshindwa kuunganisha / n"); }

// Kusoma 4: Usomaji wa Kiwango cha Kupona

ikiwa (http. anza (mwenyeji, httpPortRead, url4))

{int httpCode = http. GET (); ikiwa (httpCode> 0) {ikiwa (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Recoveryrate = http.getString (); Serial.print ("Kiwango cha Kuokoa:"); Serial.println (Upyaji wa kupona); onyesha.setCursor (0, 0); onyesha.println ("COVID19 LIVE"); onyesha.println (""); kuonyesha.println ("Kiwango cha Kuokoa:"); kuonyesha.print (Recoveryrate); onyesha.println ("%"); onyesha.display (); kuchelewesha (4000); onyesha wazi Cleplay (); }} mwingine {Serial.printf ("[HTTP] GET… imeshindwa, kosa:% s / n", http.errorToString (httpCode).c_str ()); } http.end (); } mwingine {Serial.printf ("[HTTP} Imeshindwa kuunganisha / n"); }

// Kusoma 5: Usomaji wa Kiwango cha Kifo

ikiwa (http. anza (mwenyeji, httpPortRead, url5))

{int httpCode = http. GET (); ikiwa (httpCode> 0) {ikiwa (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Deathrate = http.getString (); Serial.print ("Kiwango cha Fatality:"); Serial.println (Kufariki); onyesha.setCursor (0, 0); onyesha.println ("COVID19 LIVE"); onyesha.println (""); kuonyesha.println ("Kiwango cha Fatality:"); onyesho.print (Deathrate); onyesha.println ("%"); onyesha.display (); kuchelewesha (4000); onyesha wazi Cleplay (); onyesha.display (); }} mwingine {Serial.printf ("[HTTP] GET… imeshindwa, kosa:% s / n", http.errorToString (httpCode).c_str ()); } http.end (); } mwingine {Serial.printf ("[HTTP} Imeshindwa kuunganisha / n"); } wakati (WiFi.status ()! = WL_CONNECTED) // Endapo muunganisho wa Wifi utapotea {WiFi.disconnect (); kuchelewesha (1000); Kuanza kwa WiFi (ssid, password); Serial.println ("Kuunganisha tena kwa WiFi.."); onyesha.setCursor (0, 0); onyesha.println ("Ukali wa Kiufundi"); onyesha.println (""); display.println ("Kuunganisha…."); onyesha.display (); kuchelewesha (10000); onyesha wazi Cleplay (); onyesha.display (); }

}

/ * © Ukali wa Kiufundi

Youtube:

Maagizo: https://www.instructables.com/member/… Instagram: https://instagram.com/techtronicharsh Tovuti: https://techtronicharsh.com Telegram:

*/

Hatua ya 4: Kufanya kazi:

Fanya unganisho kulingana na mchoro wa mzunguko na pakia nambari baada ya kuchagua bodi sahihi na Bandari ya COM. Ikiwa inaonyesha kosa hakikisha umeongeza maktaba kulingana na maagizo yaliyotolewa hapo juu.

Ikiwa inachukua muda mwingi Kukimbia kwenye OLED, Hakikisha Umeunganishwa Vizuri na huduma za mtandao yaani WiFi yako au Hotspot.

Ilipendekeza: