File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66import time
77import board
8- from digitalio import DigitalInOut
8+ from digitalio import DigitalInOut , Direction , Pull
99from adafruit_hid .keyboard import Keyboard
1010from adafruit_hid .keycode import Keycode
1111from adafruit_hid .consumer_control import ConsumerControl
1818
1919# NeoPixel LED ring on pin D1
2020# Ring code will auto-adjust if not 16 so change to any value!
21- ring = neopixel .NeoPixel (D5 , 16 , brightness = 0.2 )
21+ ring = neopixel .NeoPixel (board . D5 , 16 , brightness = 0.2 )
2222dot_location = 0 # what dot is currently lit
2323
2424# Encoder button is a digital input with pullup on D9
25- button = DigitalInOut (D9 )
25+ button = DigitalInOut (board . D9 )
2626button .direction = Direction .INPUT
2727button .pull = Pull .UP
2828
2929# Rotary encoder inputs with pullup on D10 & D11
30- rot_a = DigitalInOut (D10 )
30+ rot_a = DigitalInOut (board . D10 )
3131rot_a .direction = Direction .INPUT
3232rot_a .pull = Pull .UP
33- rot_b = DigitalInOut (D11 )
33+ rot_b = DigitalInOut (board . D11 )
3434rot_b .direction = Direction .INPUT
3535rot_b .pull = Pull .UP
3636
You can’t perform that action at this time.
0 commit comments