A clock showing the weather on a Pimoroni Galactic Unicorn
A Micropython script for Pimoroni's Galactic Unicorn buy from Pimoroni shop that shows a clock as well as the weather forecast for the next 12 hours.
It uses the Open Meteo API to retrieve the weather forecast as well as to adjust the time zone.
This clock plays a random bird song every hour (you can define when the alarm sounds or not by editing the WAKING_HOURS
variable in weatherclock.py
)
- You need version 1.19.18 of the Micropython firmware for the Raspberry Pi Pico W (I am using the new HSV pen function from that release). Check https://github.com/pimoroni/pimoroni-pico/releases for Firmware updates
- You need to download
chunk.py
andwave.py
from https://github.com/joeky888/awesome-micropython-lib/tree/master/Audio into thelib
folder to read WAV files
- connect.py: creates a WIFI network connection. You need to populate a file named
WIFI_CONFIG.py
. - <location_config.py>: This is where you put your latitude, longitude and timezone to get your local forecast.
- <wave_player.py>: Uses the aforementioned
wave.py
module and the Galactic Unicorn'splay_sample
function to play WAV file. Pimoroni's playback libraries only seem to work with mono, 16-bit, 22050Hz audio, so make sure to save your WAV files in that format if you want to use your own. - <weatherclock_assets.py>: The custom fonts used for the digits, and the icons used to display weather states.
- <weatherclock.py>: The main source code for the weather clock.
- The birds directory: A Collection of bird songs from Wikimedia Commons
- Common Blackbird (Turdus merula) from Southern Finland by Oona Räisänen https://en.wikipedia.org/wiki/File:Turdus_merula_2.ogg License: Public Domain
- European Herring Gull (Larus argentatus) from the Bay of Mont-Saint-Michel in Normandie by ADVL https://commons.wikimedia.org/wiki/File:XC707075_-_European_Herring_Gull_-_Larus_argentatus.mp3 License: Creative Commons CC0 Universal Public Domain Dedication
- Carrion Crow (Corvus corone) from The Hague, South Holland by Sander Pieterse https://commons.wikimedia.org/wiki/File:Corvus_corone_-_Carrion_Crow_XC24828.mp3 License: Creative Commons Attribution-Share Alike (CC-BY-SA)
- Common Cuckoo (Cuculus canorus) from Kaluga, Russia by Vladimir Yu. Arkhipov https://en.wikipedia.org/wiki/File:Cuculus_canorus.ogg License: Creative Commons Attribution-Share Alike (CC-BY-SA)
- Canada Goose (Branta canadensis) from the United States by Jonathon Jongsma https://commons.wikimedia.org/wiki/File:Branta_canadensis_-_Canada_Goose_-_XC62259.ogg License: Creative Commons Attribution-Share Alike (CC-BY-SA)
- European Robin (Erithacus rubecula) from Tver, Russia by Vladimir Yu. Arkhipov https://en.wikipedia.org/wiki/File:Erithacus_rubecula.ogg License: Creative Commons Attribution-Share Alike (CC-BY-SA)
- Blue Tit (Cyanistes caeruleus) from Kaluzhskiye Zaseki, Russia by Vladimir Yu. Arkhipov https://commons.wikimedia.org/wiki/File:Cyanistes_caeruleus.ogg License: Creative Commons Attribution-Share Alike (CC-BY-SA)