File tree Expand file tree Collapse file tree
Introducing_CircuitPlaygroundExpress Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # CircuitPlaygroundExpress_HIDKeyboard
1+ # Circuit Playground HID Keyboard
22
33import time
44
88from adafruit_hid .keycode import Keycode
99from digitalio import DigitalInOut , Direction , Pull
1010
11- # A simple neat keyboard demo in circuitpython
11+ # A simple neat keyboard demo in CircuitPython
1212
1313# The button pins we'll use, each will have an internal pulldown
1414buttonpins = [board .BUTTON_A , board .BUTTON_B ]
2525# we're americans :)
2626layout = KeyboardLayoutUS (kbd )
2727
28- # make all pin objects, make them inputs w/ pulldowns
28+ # make all pin objects, make them inputs with pulldowns
2929for pin in buttonpins :
3030 button = DigitalInOut (pin )
3131 button .direction = Direction .INPUT
5353 while button .value :
5454 pass # wait for it to be released!
5555 # type the keycode or string
56- k = buttonkeys [i ] # get the corresp. keycode/str
56+ k = buttonkeys [i ] # get the corresponding keycode or string
5757 if isinstance (k , str ):
5858 layout .write (k )
5959 else :
You can’t perform that action at this time.
0 commit comments