File tree Expand file tree Collapse file tree
CircuitPython_NeoPixel_Example
CircuitPython_Touch_Example Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """NeoKey Trinkey NeoPixel Rainbow Example"""
2+ import time
3+ import board
4+ import neopixel
5+ from _pixelbuf import colorwheel
6+
7+ pixel = neopixel .NeoPixel (board .NEOPIXEL , 1 , auto_write = False )
8+
9+ pixel .brightness = 0.3
10+
11+
12+ def rainbow (delay ):
13+ for color_value in range (255 ):
14+ for led in range (1 ):
15+ pixel_index = (led * 256 // 1 ) + color_value
16+ pixel [led ] = colorwheel (pixel_index & 255 )
17+ pixel .show ()
18+ time .sleep (delay )
19+
20+
21+ while True :
22+ rainbow (0.02 )
Original file line number Diff line number Diff line change 1+ """NeoKey Trinkey Capacitive Touch Example"""
2+ import time
3+ import board
4+ import touchio
5+
6+ touch = touchio .TouchIn (board .TOUCH )
7+
8+ while True :
9+ if touch .value :
10+ print ("Pad touched!" )
11+ time .sleep (0.1 )
You can’t perform that action at this time.
0 commit comments