Skip to content

Commit 1985550

Browse files
authored
Merge pull request adafruit#1883 from kattni/eyelights
Add EyeLights guide code, update script.
2 parents fe66035 + 0f09c01 commit 1985550

File tree

2 files changed

+21
-0
lines changed
  • CircuitPython_Templates/i2c_find_pins
  • EyeLights_LED_Glasses_and_Driver/Digital_Input

2 files changed

+21
-0
lines changed

CircuitPython_Templates/i2c_find_pins/code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def get_unique_pins():
2929
"LED",
3030
"SWITCH",
3131
"BUTTON",
32+
"ACCELEROMETER_INTERRUPT",
33+
"VOLTAGE_MONITOR",
34+
"MICROPHONE_CLOCK",
35+
"MICROPHONE_DATA",
3236
]
3337
if p in dir(board)
3438
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
CircuitPython Digital Input Example - Blinking an LED using a button switch.
3+
"""
4+
import board
5+
import digitalio
6+
7+
led = digitalio.DigitalInOut(board.LED)
8+
led.direction = digitalio.Direction.OUTPUT
9+
10+
button = digitalio.DigitalInOut(board.SWITCH)
11+
button.switch_to_input(pull=digitalio.Pull.UP)
12+
13+
while True:
14+
if not button.value:
15+
led.value = True
16+
else:
17+
led.value = False

0 commit comments

Comments
 (0)