Fix formatting and make lab68 bluetooth

This commit is contained in:
Dimitris Zervas 2020-09-14 04:02:40 +03:00 committed by Kyle Brown
parent b082f26d9e
commit 4d46653526
2 changed files with 28 additions and 9 deletions

View File

@ -46,12 +46,32 @@ class MatrixScanner:
# https://github.com/adafruit/Adafruit_CircuitPython_MCP230xx/blob/3f04abbd65ba5fa938fcb04b99e92ae48a8c9406/adafruit_mcp230xx/digital_inout.py#L33
if self.diode_orientation == DiodeOrientation.COLUMNS:
self.outputs = [x if x.__class__.__name__ is "DigitalInOut" else digitalio.DigitalInOut(x) for x in cols]
self.inputs = [x if x.__class__.__name__ is "DigitalInOut" else digitalio.DigitalInOut(x) for x in rows]
self.outputs = [
x
if x.__class__.__name__ is 'DigitalInOut'
else digitalio.DigitalInOut(x)
for x in cols
]
self.inputs = [
x
if x.__class__.__name__ is 'DigitalInOut'
else digitalio.DigitalInOut(x)
for x in rows
]
self.translate_coords = True
elif self.diode_orientation == DiodeOrientation.ROWS:
self.outputs = [x if x.__class__.__name__ is "DigitalInOut" else digitalio.DigitalInOut(x) for x in rows]
self.inputs = [x if x.__class__.__name__ is "DigitalInOut" else digitalio.DigitalInOut(x) for x in cols]
self.outputs = [
x
if x.__class__.__name__ is 'DigitalInOut'
else digitalio.DigitalInOut(x)
for x in rows
]
self.inputs = [
x
if x.__class__.__name__ is 'DigitalInOut'
else digitalio.DigitalInOut(x)
for x in cols
]
self.translate_coords = False
else:
raise ValueError(

View File

@ -1,14 +1,13 @@
import board
import busio
from digitalio import DigitalInOut, Direction, Pull
from adafruit_mcp230xx.mcp23017 import MCP23017
from kmk.kmk_keyboard import KMKKeyboard
from kmk.hid import HIDModes
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
# DEBUG_ENABLE = True
i2c = busio.I2C(scl=board.SCL, sda=board.SDA, frequency=100000)
@ -71,4 +70,4 @@ keyboard.keymap = [
]
if __name__ == '__main__':
keyboard.go()
keyboard.go(hid_type=HIDModes.BLE)