Git Product home page Git Product logo

coronavirus_tracker's Introduction

Coronavirus_Tracker

Arduino code that tracks the spread of the Coronavirus and displays it on an OLED display

Coronavirus Tracker

What does this do?

When run on an ESP8266 microcontroller, this code does the following:

  1. Connects to the configured 2.4GHz WiFi network
  2. Sends an HTTP GET request to two endpoints and retreives:
    • Updated Coronavirus data for the whole world
    • Updated Coronavirus data for a specific countrt
  3. Parses the JSON response and extracts:
    • Number of cases
    • Number of deaths
  4. Displays the extracted information on the OLED display
  5. Sleeps for 10 minutes
  6. Goto 2

Data Source

The data displayed originates from two endpoints:

  1. https://corona.lmao.ninja/v2/all - returns a JSON object with updated Coronavirus data for the whole world
  2. https://corona.lmao.ninja/v2/countries/COUNTRY_NAME - returns a JSON object with updated Coronavirus data for the country name after the last slash

Code Configuration

The following code changes need to be made prior to compiling and uploading to the ESP8266:

  1. Line 34 - enter the required WiFi network name (the ESP8266 can connect only to 2.4GHz networks, not 5GHz ones)
  2. Line 35 - enter the required WiFi network password
  3. Line 37 - enter the required country name
  4. Line 98 - enter the required country name

Hardware Components

  1. ESP8266 - a low-cost WiFi microchip, with a full TCP/IP stack and microcontroller capability. Basically, the brains of this project
  2. SSD1306 - a monochrome 0.96" 128x64 IIC OLED graphic display

Schematic

Schematic

Notes

  1. Changing the sleep time requires updating the value passed to the delay function on line 105
  2. Parsing a different parameter from the JSON response requires updating the name of the key in either line 60, 61, 73 or 74 (in order to see the possible keys, you can open the URL in your browser and review the response)
  3. Replacing the provided endpoints with different ones requires updating the URL values in lines 37 and 38

coronavirus_tracker's People

Contributors

zoharsf avatar

Stargazers

David avatar Vincent Kok avatar EpicMario71 avatar erikmorse avatar Caret avatar

Watchers

James Cloos avatar  avatar Patrick Fougere avatar

Forkers

cvpeck

coronavirus_tracker's Issues

new address for the end point.

Hello,

I am not sure you are aware that the end point has changed to this:
https://corona.lmao.ninja/v2/countries

I noticed when the code was only pulling 0's for a day or two.

"Country_Name"

"Country_Name" does not pull the country name in or is it a variable that needs to be manually changed?
Found around line 108.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.