I built a small project to test the Raspberry Pi Pico with the Pico LCD 1.3 module. This turns out to be a very nice gift for any person who sits in the office all day. The device will remind every 30 minutes to drink water. You can connect it to a computer and put it on a desk. Additionally, I added a small game mode to it, so one can also play a round of PONG.
This drink water reminder consists only of these three off-shelf components. No soldering is required:
- Raspberry Pi Pico with pre-soldered headers (amazon.de*)
- Waveshare Pico LCD 1.3 (amazon.de*)
- micro-USB cable
The device reminds every 30 minutes with a short flashing of the LCD with a special image.
With one click on the joystick the device starts a game of traditional pong. The user can control his paddle with the joystick. The game goes until a score of 25 points.
As always I published the source code on GitHub. The source code is based on the LCD sample code from waveshare and my PONG code from Wordclock 2.0. I stick with plain C-code so I had to rewrite the PONG code from object-oriented to a variant using a global struct for holding the PONG game state.
The software architecture is very simple. A state machine with 5 states controls the whole functionality. Inputs to the device are the five positions of the joystick: ‘up’, ‘down’, ‘left’, ‘right’, ‘ctrl’.
To display the images (I have included two different images, which are shown alternating) I used the converter from this website to convert a 240x240px large JPG image to an Arduino-like uint16_t array. In this array one pixel is represented by 2 bytes. I saved then the arrays in a normal .c-file in the sourcecode.
3D printed case
I constructed the case for the drink water reminder with Fusion360 and printed it on my 3D-printer Monoprice Select Mini V2. The case consists of a top, a bottom part and a cover for the joystick. The cover is clued onto the joystick with some hotclue. For mounting the bottom and the top part I decided to include a small clamping structure in the design.
The STL files can be downloaded here:
* The links are affiliate links. The offers do not come from me, however, I receive a commission through the reference, if then a purchase takes place, but without you incurring additional costs.