Third party cookies may be stored when visiting this site. Please see the cookie information.

PenguinTutor YouTube Channel

Programming a GUI menu for an E-ink display - Badger 2040W

The Badger 2040 W is a hackable ID badge with wireless capability. It is powered by a Raspberry Pi Pico, it has an E-Ink display and buttons for interactivity. You can also connect it to I2C devices through a Qwicc / STEMMA QT connector.

In my Badger 2040W project page I have provided a review of the Badger 2040 W explaining that it could be used as more than an ID Badge.

In this video I explain about programming a menu system for the Badger 2040W, using Object-Oriented Programming in MicroPython.

Badger 2040W WiFi enabled conference ID badge - with Pixel server menu system

The client is fully functional and can configure various aspects of the Pixel Server, including changing the sequence, setting the colours and setting the delay value (speed of the sequence).

Object-Oriented Programming

The main part of the menu is designed using object-oriented programming. This diagram shows a simplified UML class diagram showing the BadgerMenu class and the BadgerMenuItem class.

UML class diagram object-oriented programming Badger Menu System

The BadgerMenu has zero or more BadgerMenuItems. Although it's not much use with zero items, so normally there should be at least two items added. It only shows some of the methods and attributes and whilst some are shown as private there is no such distinction in Python. There is a convention that private attributes and methods have an underscore at the start, I have done this for some methods, but I have also left some without the underscore. This is something that may change in future versions.

Badger Slider

The BadgerSlider is a separate class which implements a slider which can be moved across the screen. This can be used to request a numerical value from the user between pre-set limits. It normally has the lowest number on the left and the highest on the right, but can be reversed as shown in the image below.

Badger 2040W with e-ink display and slider menu

Source code

The source code for the Pixel Client is available on Github. See the Readme.md file for details of how to install on the Badger 2040 W.

More information

More information about the Badger 2040W and my other programming guides at:

Blog links and videos on programming

Previous Badger 2040 drawing circles
Badger 2040 drawing circles
Next Programming books
Programming books