File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
CircuitPython NeoPixel Blink example - blinking the built-in NeoPixel(s).
3
3
4
+ This example is meant for boards that have built-in NeoPixel LEDs but do not have a little
5
+ red LED. If a little red LED is present, use the standard Blink template and example.
6
+
4
7
Update NUMBER_OF_PIXELS to the match the number of built-in NeoPixels on the board.
5
8
6
9
DO NOT INCLUDE THE pylint: disable LINE IN THE GUIDE CODE. It is present only to deal with the
Original file line number Diff line number Diff line change
1
+ """
2
+ CircuitPython Touch Input Example - Blinking an LED using a capacitive touch pad.
3
+
4
+ This example is meant for boards that have capacitive touch pads, and no simple way to wire up
5
+ a button. If there is a simple way to wire up a button, or a button built into the board, use
6
+ the standard Digital Input template and example.
7
+
8
+ Update TOUCH_PAD_PIN to the pin for the capacitive touch pad you wish you use.
9
+
10
+ For example:
11
+ If are using a BLM Badge and plan to use the first pad, change TOUCH_PAD_PIN to CAP1.
12
+ """
13
+ import board
14
+ import digitalio
15
+ import touchio
16
+
17
+ led = digitalio .DigitalInOut (board .D13 )
18
+ led .direction = digitalio .Direction .OUTPUT
19
+
20
+ touch = touchio .TouchIn (board .TOUCH_PAD_PIN )
21
+
22
+ while True :
23
+ if touch .value :
24
+ led .value = True
25
+ else :
26
+ led .value = False
You can’t perform that action at this time.
0 commit comments