We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2c05295 + 702743a commit acefa00Copy full SHA for acefa00
Adafruit_QT_Py_ESP32-S2/digital_input/code.py
@@ -0,0 +1,19 @@
1
+# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2
+# SPDX-License-Identifier: MIT
3
+"""
4
+CircuitPython Digital Input example - Blinking a built-in NeoPixel LED using a button switch.
5
6
+import board
7
+import digitalio
8
+import neopixel
9
+
10
+pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
11
12
+button = digitalio.DigitalInOut(board.BUTTON)
13
+button.switch_to_input(pull=digitalio.Pull.UP)
14
15
+while True:
16
+ if not button.value:
17
+ pixel.fill((255, 0, 0))
18
+ else:
19
+ pixel.fill((0, 0, 0))
0 commit comments