Skip to content

Commit e79250e

Browse files
authored
add board prefixes and direction/pull
1 parent 8db4c24 commit e79250e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Crank_USB_HID/code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import time
77
import board
8-
from digitalio import DigitalInOut
8+
from digitalio import DigitalInOut, Direction, Pull
99
from adafruit_hid.keyboard import Keyboard
1010
from adafruit_hid.keycode import Keycode
1111
from adafruit_hid.consumer_control import ConsumerControl
@@ -18,19 +18,19 @@
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)
2222
dot_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)
2626
button.direction = Direction.INPUT
2727
button.pull = Pull.UP
2828

2929
# Rotary encoder inputs with pullup on D10 & D11
30-
rot_a = DigitalInOut(D10)
30+
rot_a = DigitalInOut(board.D10)
3131
rot_a.direction = Direction.INPUT
3232
rot_a.pull = Pull.UP
33-
rot_b = DigitalInOut(D11)
33+
rot_b = DigitalInOut(board.D11)
3434
rot_b.direction = Direction.INPUT
3535
rot_b.pull = Pull.UP
3636

0 commit comments

Comments
 (0)