Member-only story
The Raspberry Pi Advent Calendar that Dispenses Chocolate!
The modern Raspberry Pi + LEGO approach to Advent calendars is awesome.
The temptation of chocolate is ever-present in our lives. No matter how hard we try to hold out, no matter our convictions… at the end of the day, chocolate is just plain sinfully delicious. But that’s where technology can step in to save us from ourselves.
This Raspberry Pi uses the Build HAT with attached LEGO components to create the perfect method of controlled chocolate delivery. Inventor Richard Hayler realized that his incredibly clever children would nick all the chocolates on December the 1st, then carefully close all the doors of the Advent calendar afterward. Naturally, Richard set out to solve this problem with the world’s smallest and most versatile computer.
“Re-Adventing” the calendar
Using the new Raspberry Pi Build HAT (which allows the Raspberry Pi to connect with various LEGO motors and sensors), Richard was able to knock out some precision motor control far easier than it would have been just a few years ago.
The Raspberry Pi keeps a log file of whenever chocolate is released. This is a genius stroke because it can’t be gotten around by simply rebooting the Raspberry Pi and tricking it into forgetting which day of the month it is. Instead, the system checks to see if a chocolate has been listed in its log file and combines that with its calendar, allowing it to be sure that no two chocolates are dispensed on any one day.
The Raspberry Pi keeps a log file of whenever chocolate is released.