-
Notifications
You must be signed in to change notification settings - Fork 1
How it Works
The Pi connects to Google Calendar and checks every minute for upcoming appointments then flashes the Unicorn HAT's LEDs for following alerts:
- White @ 10 minutes until 5 minutes
- Yellow @ 5 minutes until 2 minutes
- Multi-color swirl @ 2 minutes
If you're feeling adventurous, you can change the code to use any of the sample patterns included with the Unicorn HAT HD Sample Code. I'm personally a big fan of the star field example, but that's not very useful as an alerting mechanism.
Pi Remind also displays a single indicator LED on the bottom row of the display to let you know the app is working. It will illuminate a single LED along the bottom row of the Unicorn HAT and move the LED across the display every time it connects to Google to obtain calendar information. The color of the LED indicates status of the app as well:
- Blue - The app is connecting to the Google Calendar API
- Green - The app received data from the Google Calendar API, but there are no pending appointments within the next 10 minutes
- Red - The app encountered an error connecting to the Google Calendar API
- White - There is an appointment beginning within 10 minutes
- Yellow - There is an appointment beginning within the next 5 minutes
- Orange - There is an appointment beginning within the next 2 minutes
This way, even if you miss the flashing lights, you can glance at the display and still determine if you have an upcoming appointment.
This feature also makes the Pi Remind device a network connection warning device. Whenever the device detects a network error, it turns all LEDs Red for a short while letting you know. If you're on a video call and all of a sudden you see RED LEDs on the device, you'll know your call is about to disconnect.
If you find this code useful, and feel like thanking me for providing it, please consider making a purchase from my Amazon Wish List. You can find information on many different topics on my personal blog. Learn about all of my publications at John Wargo Books.