Skip to content

Commit e45b246

Browse files
updated for new libraries
1 parent 0753adc commit e45b246

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

VOTE_Keyboard/code.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import board
22
from digitalio import DigitalInOut, Direction, Pull
3-
import adafruit_dotstar as dotstar
3+
import usb_hid
44
from adafruit_hid.keyboard import Keyboard
55
from adafruit_hid.keycode import Keycode
66
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
77

8-
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
9-
dot[0] = (0, 0, 0)
10-
11-
kbd = Keyboard()
8+
kbd = Keyboard(usb_hid.devices)
129
kbdLayout = KeyboardLayoutUS(kbd)
1310
state = []
1411
pins = {}
@@ -58,8 +55,7 @@
5855
for oldID in oldState:
5956
if not oldID in newState:
6057
kbd.release(buttonIDtoKeycode[oldID])
61-
dot[0] = (0, 0, 0)
6258
if newBtn:
6359
kbd.press(buttonIDtoKeycode[newBtn])
64-
dot[0] = (255, 0, 0)
6560
state = newState
61+

0 commit comments

Comments
 (0)