Skip to content
Ethan edited this page Feb 6, 2024 · 18 revisions

This program includes 3 libraries that can help you quickly get a new app up and running.

keyboard.py

This library makes it easy to get button inputs from the keyboard matrix on the Cardputer. To use it, you import it with:
from lib import keyboard

Then, you can access the pressed keys like this:

kb = keyboard.KeyBoard() # init the object controlling our keyboard
pressed_keys = kb.get_pressed_keys() # return the currently pressed keys in a list

And that's it! It even automatically applies the 'shift' and 'fn' keys for you, so it's very quick and easy to work with.
Take a look at the keymaps at the top of lib/keyboard.py if you want to see all the possible key values.

st7789.py

beeper.py

Clone this wiki locally