Since the beginning of 2020 all we are living through a very complicated and difficult period.
Covid-19 has changed our habits, sociality when it does not affect our relatives or friends.
For this reason, between a lock-down and another it is important to keep up to date to know how much we are at risk in our country or city.
The project is mainly based on an Esp32 device with an LCD, so I wondered, why not use the M5Stack Core? YES!
After purchasing the Core Gray with some units and trying UiFlow, I decided it was time to write my own code in upython.
I found M5Stack Core very interesting for this project and other.
In this period I am using several M5Stack products which I find very valid for educational and STEM projects.
Remember, to setup the M5 Stack cores to work, we need to have a MicroPython firmware flashed to our device. The actual Uiflow version used is 1.6.3.
First of all you need to flash your device with the last M5Burner firmware found in the downloads section of the M5Stack website or directly from the UiFlow Settings menu, once open from browser.
For the upython code nothing of relevant but replacing wifi credential with yours.
# connect to your wifi
wifiCfg.doConnect('YOUR SSID', 'YOUR PASSWD')Actually the project is based to italian json data, but I think maybe easy adapt it to another data source
# retrieve json data from official github of Italian Civil Protection DPT. Data were updates daily after 17:00
req = urequests.get("https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-json/dpc-covid19-ita-regioni-latest.json"
)All the code is available on my github repository
If need some changes, have a look at the json structure or contact me:
[
{
"data": "2020-09-12T17:00:00",
"stato": "ITA",
"codice_regione": 13,
"denominazione_regione": "Abruzzo",
"lat": 42.35122196,
"long": 13.39843823,
"ricoverati_con_sintomi": 37,
"terapia_intensiva": 3,
"totale_ospedalizzati": 40,
"isolamento_domiciliare": 504,
"totale_positivi": 544,
"variazione_totale_positivi": 3,
"nuovi_positivi": 11,
"dimessi_guariti": 2962,
"deceduti": 472,
"casi_da_sospetto_diagnostico": 3468,
"casi_da_screening": 510,
"totale_casi": 3978,
"tamponi": 173892,
"casi_testati": 112658,
"note": null
},
{.......... other data
},
]
Comments