- Section 1 - Temperature. Depending on the temperature I wanted to color the 15 LEDs a specific color.
- temp > 44 and < 80 = Green
- temp > 79 and < 90 = Yellow
- temp > 90 = Red
- temp > 34 and < 45 = Yellow
- temp < 34 = Red
- Section 2 - Wind.
- wind < 5 = green
- wind = 5 and < 16 = Yellow
- wind > 15 = Red
- Section 3 - Humidity
- Humidity < 61 = Green
- humidity > 61 and < 80 = Yellow
- humidity > 80 = Red
- Section 4 - Condition
- If it is not raining - Green
- If it is raining - Red
I am using the Open Weather Map API. You can sign up for a free account here: https://openweathermap.org/. I setup an infinite while loop that will sleep for 10 minutes between each iteration. I also set it up to only turn the LEDs on between 10AM and 2PM. The API will only be called during these times. I typically take a run around lunch time so no need to keep it on after this.
0 comments:
Post a Comment