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

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

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()