Prepare things for the event loop, also abstract gross stuff from end users

This commit is contained in:
Josh Klar committed 2018-09-03 03:22:11 -07:00
1 parent 1df2012c7a
commit d5de2601d9
9 files changed
+72 -35

No files matched your search

+12 -10
View File
@@ -1,23 +1,25 @@
import board
from kmk.circuitpython.matrix import MatrixScanner
from kmk.common.consts import DiodeOrientation
from kmk.common.keymap import Keymap
from kmk.firmware import Firmware
def main():
cols = (board.A4, board.A5)
rows = (board.D27, board.A6)
matrix = MatrixScanner(
cols=cols, rows=rows,
diode_orientation=DiodeOrientation.COLUMNS,
)
diode_orientation = DiodeOrientation.COLUMNS
keymap = Keymap([
keymap = [
['A', 'B'],
['C', 'D'],
])
]
while True:
keymap.parse(matrix.raw_scan())
firmware = Firmware(
keymap=keymap,
row_pins=rows,
col_pins=cols,
diode_orientation=diode_orientation,
)
firmware.go()