Connecting to the Cloud
This clock doesn't just tick; it thinks! By connecting to the internet, it can fetch data that it can't measure itself, like the weather forecast for tomorrow.
APIs (Application Programming Interfaces)
An API is like a menu for a restaurant. We send a request ("Give me the weather for London"), and the server sends back the "food" (data).
We will use the OpenWeatherMap API. The data usually comes back in JSON format:
JSON
1{
2 "weather": [
3 {
4 "main": "Rain",
5 "description": "light rain"
6 }
7 ],
8 "main": {
9 "temp": 285.32
10 }
11}