Adding template examples.

This commit is contained in:
Kattni Rembor 2021-05-26 12:51:50 -04:00
parent eb6403abe4
commit b9058d8fb9
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,22 @@
"""NeoKey Trinkey NeoPixel Rainbow Example"""
import time
import board
import neopixel
from _pixelbuf import colorwheel
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, auto_write=False)
pixel.brightness = 0.3
def rainbow(delay):
for color_value in range(255):
for led in range(1):
pixel_index = (led * 256 // 1) + color_value
pixel[led] = colorwheel(pixel_index & 255)
pixel.show()
time.sleep(delay)
while True:
rainbow(0.02)

View file

@ -0,0 +1,11 @@
"""NeoKey Trinkey Capacitive Touch Example"""
import time
import board
import touchio
touch = touchio.TouchIn(board.TOUCH)
while True:
if touch.value:
print("Pad touched!")
time.sleep(0.1)