COVID-19 Real-Time Data Monitor
2020-04-07 | By M5Stack
License: General Public License
* Thanks for the source code and project information provided by @Niyas Thalappil
This simple tracker will help you to the current situation of different countries due to COVID-19 outbreaks. Also, it will show alternating the current data of different countries of your choice.
The data is collected by the website: www.worldometers.info/coronavirus/
Hardware
M5StickC is a mini M5Stack, powered by ESP32. It is a portable, easy-to-use, open-source, IoT development board. This tiny block is able to create and prototyping any project as your idea.
WiFi Connection
/*____Wifi _____________________*/
#define WIFI_SSID "JioFi" // Enter your SSID here
#define WIFI_PASS "Niyast90" // Enter your WiFi password here
In this, I just added on a few countries. If you can change/add/delete the countries in the main loop of the program according to your interests.
void loop() {
check_country("India");
delay(2000);
check_country("Kuwait");
delay(2000);
check_country("Saudi-Arabia");
delay(2000);
check_country("Qatar");
delay(2000);
check_country("US");
delay(2000);
check_country("Italy");
delay(2000);
check_country("China");
delay(2000);
check_country("Spain");
delay(2000);
}
Note:
Please check the correct names of the needed countries on www.worldometers.info/coronavirus/
Battery Status
The M5StickC has a built-in battery. So I just added to a battery status monitor to understand the battery charge.
void battery_status()
{
vbat = M5.Axp.GetVbatData() * 1.1 / 1000;
discharge = M5.Axp.GetIdischargeData() / 2;
if (vbat >= 4)
{
M5.Lcd.pushImage(145, 1, 14, 8, bat_3);
}
else if (vbat >= 3.7)
{
M5.Lcd.pushImage(145, 1, 14, 8, bat_2);
}
else if (vbat < 3.7)
{
M5.Lcd.pushImage(145, 1, 14, 8, bat_1);
}
else
{}
// M5.Lcd.setTextColor(TFT_YELLOW);
// M5.Lcd.setCursor(140, 12);
// M5.Lcd.setTextSize(1);
// M5.Lcd.println(discharge);
}