Skip to content

How it Works

John M. Wargo edited this page May 5, 2020 · 3 revisions

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.