File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
CircuitPython_Templates/i2c_find_pins
EyeLights_LED_Glasses_and_Driver/Digital_Input Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff 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 ]
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments