7c47b1c53f | ||
---|---|---|
.. | ||
assets | ||
README.md | ||
badge.py | ||
badger_os.py | ||
battery.py | ||
button_test.py | ||
clock.py | ||
conway.py | ||
ebook.py | ||
fonts.py | ||
help.py | ||
image.py | ||
info.py | ||
launcher.py | ||
led.py | ||
list.py | ||
micropython-builtins.cmake | ||
pin_interrupt.py | ||
qrgen.py |
README.md
Badger 2040 Examples
Function Examples
Battery
An example of how to read the battery voltage and display a battery level indicator.
Button Test
An example of how to read Badger2040's buttons and display a unique message for each.
LED
Blinks Badger's LED on and off.
Pin interrupt
An example of drawing text and graphics and using the buttons.
Application Examples
Badge
Create your own name badge! This application looks for two files on your MicroPython drive:
badge.txt
- A text file containing 6 lines, corresponding to the 6 different pieces of text on the badgebadge-image.bin
- A 108x128px 1-bit colour depth image to display alongside the text. You can useexamples/badger2040/image_converter/convert.py
to convert them:
python3 convert.py --binary --resize image_file_1.png image_file_2.png image_file_3.png
Checklist
A checklist application, letting you navigate through items and tick each of them off.
checklist.txt
- A text file containing the titles of items for the list.
Clock
A simple clock showing the time and date, that uses the E Ink's fast speed to update every second.
E-Book
A mini text file e-reader. Comes pre-loaded with an excerpt of The Wind In the Willows.
Fonts
A demonstration of the various fonts that can be used in your programs.
Image
An image gallery. Displays and lets you cycle through any images stored within the MicroPython device's /images
directory. Images must be 296x128 pixels with 1-bit colour depth. You can use examples/badger2040/image_converter/convert.py
to convert them:
python3 convert.py --binary --resize image_file_1.png image_file_2.png image_file_3.png
QR gen
Displays and lets you cycle through multiple QR codes, with configuration stored in text files within the MicroPython device's /qrcodes
directory.
/qrcodes/qrcode.txt
- A text file containing 9 lines. The first line should be a URL which will be converted into and displayed as a QR code. Up to 8 more lines of information can be added, which will be shown as plain text to the right of the QR code./qrcodes/*.txt
- additional text files can be created using the same format. All text files can be cycled through.
Launcher
A launcher-style application, providing a menu of other applications that can be loaded, as well as information such as battery level.
Conway
Conway's classic Game of Life, implemented on the Badger. Note: this application is not linked from the Launcher by default - it can be run directly using Thonny or your MicroPython editor of choice, or you can modify the Launcher to add it (you'll want to update launchericons.png
as well)