- Learn Linux
- Learn Electronics
- Raspberry Pi
- LPI certification
- News & Reviews
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.
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).
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.
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.
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.
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 about the Badger 2040W and my other programming guides at: