pimoroni-pico/micropython/examples/badger2040
Mike Bell be0f1358d1 Merge remote-tracking branch 'origin/MichaelBell-battery-improvements' into battery-improvements 2022-03-25 15:35:48 +00:00
..
assets qrcode: Add example to badgerOS 2022-03-11 12:52:29 +00:00
README.md Fix filenames in examples README 2022-03-13 17:22:59 +00:00
badge.py Badger2040: JSON app state. 2022-03-25 14:25:27 +00:00
badger_os.py Badger2040: Fix exit to launcher. 2022-03-25 15:14:34 +00:00
battery.py Fix filenames in examples README 2022-03-13 17:22:59 +00:00
button_test.py Fix filenames in examples README 2022-03-13 17:22:59 +00:00
clock.py Badger2040: Fixup examples for Act LED and A+C to exit. 2022-03-25 11:35:52 +00:00
conway.py add conways game of life 2022-03-17 19:10:43 +00:00
ebook.py I learn how to run the linter locally 2022-03-25 14:51:23 +00:00
fonts.py Badger2040: Fixup examples for Act LED and A+C to exit. 2022-03-25 11:35:52 +00:00
help.py Badger2040: Fixup examples for Act LED and A+C to exit. 2022-03-25 11:35:52 +00:00
image.py Badger2040: Improve launcher. 2022-03-25 14:55:56 +00:00
info.py Badger2040: Fixup examples for Act LED and A+C to exit. 2022-03-25 11:35:52 +00:00
launcher.py Badger2040: Fix exit to launcher. 2022-03-25 15:14:34 +00:00
led.py Lint LED example 2022-03-04 12:34:44 +00:00
list.py Badger2040: Fixup examples for Act LED and A+C to exit. 2022-03-25 11:35:52 +00:00
micropython-builtins.cmake Badger2040: Create badger_os utils module. 2022-03-24 23:20:46 +00:00
pin_interrupt.py Fix filenames in examples README 2022-03-13 17:22:59 +00:00
qrgen.py Badger2040: qrgen now halts 2022-03-25 15:27:37 +00:00

README.md

Badger 2040 Examples

Function Examples

Battery

battery.py

An example of how to read the battery voltage and display a battery level indicator.

Button Test

button_test.py

An example of how to read Badger2040's buttons and display a unique message for each.

LED

led.py

Blinks Badger's LED on and off.

Pin interrupt

pin_interrupt.py

An example of drawing text and graphics and using the buttons.

Application Examples

Badge

badge.py

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 badge
  • badge-image.bin - A 108x128px 1-bit colour depth image to display alongside the text. 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

Checklist

list.py

A checklist application, letting you navigate through items and tick each of them off.

Clock

clock.py

A simple clock showing the time and date, that uses the E Ink's fast speed to update every second

E-Book

ebook.py

A mini text file e-reader. Comes pre-loaded with an excerpt of The Wind In the Willows.

Fonts

fonts.py

A demonstration of the various fonts that can be used in your programs.

Image

image.py

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

qrgen.py

This application looks for a file on your MicroPython drive:

  • 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.

Launcher

launcher.py

A launcher-style application, that provide a menu of other applications that can be loaded, as well as information such as battery level.