Day 10: Temperature display
Today’s project is an intuitive display of the current temperature. With a single look, you can guess at whether it is sensible to take along a warm jacket.
Behind today’s door, there is another LED. This is a special one. It is an RGB-LED. RGB means Red, Green, Blue, the LED actually is made up of several LEDs with a shared cathode connection. A combination of the different colours with different brightnesses permits presenting almost any colour. The LED can be connected to the PWM outputs D3, D5, D6 of the controller with dropping resistors.
The program: Day10_TCPWeatherUpdate
Today’s sketch is about querying a website again, but this time a weather site. Formerly the website was the well known site www.openweathermap.org, but due to changes in their API i had to create an other webservice, from which you can get the current temperatur. But this webservices source is still openweathermap.com. So the new weblink is:
On this page, you can get information on the weather in your town by varying the URL. In the program just enter the city you want to query in the source text behind CITY. As an example, I am using my home town Essen.
The link to the webservice would be:
The programme now reads the temperature from this page and shows the result in colour via the RGB-LED. At the same time, the value is output via the serial monitor. The temperature range used in the example program for display on the LED is -20°C to +40°C.