crickit_neopixel_simpletest.py
1 # Crickit library demo - NeoPixel terminal 2 # Note: On CPX Crickit, NeoPixel pin is normally connected to A1, not to seesaw, 3 # so this demo would not control the NeoPixel terminal. 4 # On the Crickit FeatherWing, the NeoPixel terminal is controlled by seesaw. 5 6 # pylint can't figure out "np" can be indexed. 7 # pylint: disable=unsupported-assignment-operation 8 9 import time 10 from adafruit_crickit import crickit 11 12 # Strip or ring of 8 NeoPixels 13 crickit.init_neopixel(8) 14 15 crickit.neopixel.fill(0) 16 17 # Assign to a variable to get a short name and to save time. 18 np = crickit.neopixel 19 20 while True: 21 np.fill(0) 22 time.sleep(1) 23 np[0] = (100, 0, 0) 24 np[1] = (0, 100, 0) 25 np[2] = (0, 0, 100) 26 time.sleep(1) 27 np.fill((100, 100, 100)) 28 time.sleep(1)