Check out the official project website here
This code should run on any CircuitPython-enabled board, but is most useful when there is >= 4MB of flash. As of May 2021, it's only been tested on various RP2040 dev boards.
Board-agnostic code lives in the core directory.
Board-specific code - for things like driving indicator LEDs, GPIO mappings - are in other folders. Word libraries are also in these individual directories for now, as certain dev boards have less flash space. Those boards have smaller default libraries. Currently supported boards:
There are also macos
/win32
folders, which contain mocked IO dependencies so that the firmware can be
tested natively on desktop. For key press detection on Mac, you'll need to give accessibility permissions to Python.
- Run
python3 bundle.py
from this directory. This will create abundle
directory, which will copy all required files into folders to be loaded onto each board. - Find the directory with your board's name in the
bundle
directory. Copy all files/subdirectories onto your CircuitPython device. - If your board requires third-party libraries to run this code (most do), you may have to manually copy them. Each board's
bundle
directory will contain a README listing all of the required dependencies. Official CircuitPython libraries available here. As of May 2021, I have been using Bundle version 6.x. - If you're using one of the desktop versions, execute
python3 code.py
from thebundle/[macos/win32]
directory. You'll have topip3 install pynput
as well.
You can customize which letters get attached to each key by changing the keypad_dict
dictionary in code.py
. The default is:
keypad_dict = {
'1' : ['1'],
'2' : ['a', 'b', 'c'],
'3' : ['d', 'e', 'f'],
'4' : ['g', 'h', 'i'],
'5' : ['j', 'k', 'l'],
'6' : ['m', 'n', 'o'],
'7' : ['p', 'q', 'r', 's'],
'8' : ['t', 'u', 'v'],
'9' : ['w', 'x', 'y', 'z'],
'0' : [' ', '0', '\n'],
'#' : ['.', ',', '?', '!']
}
But as Ben Torvaney discovered, you can optimize your typing even further by using something like:
keypad_dict = {
'1' : ['1'],
'2' : ['a', 'm', 'r'],
'3' : ['c', 'd', 'f', 'p', 'u'],
'4' : ['h', 'n', 'q', 't'],
'5' : ['i', 'l', 'w', 'y'],
'6' : ['b', 'e', 'g', 'v', 'x'],
'7' : ['j', 'k', 'o', 's', 'z'],
'8' : ['8'],
'9' : ['9'],
'0' : [' ', '0', '\n'],
'#' : ['.', ',', '?', '!']
}
Note that the keypad will not run unless all characters are accounted for!