code.py
1 # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries 2 # SPDX-License-Identifier: MIT 3 """ 4 CircuitPython NeoPixel Blink example - blinking the built-in NeoPixel(s). 5 6 This example is meant for boards that have built-in NeoPixel LEDs but do not have a little 7 red LED. If a little red LED is present, use the standard Blink template and example. 8 9 Update NUMBER_OF_PIXELS to the match the number of built-in NeoPixels on the board. 10 11 DO NOT INCLUDE THE pylint: disable LINE IN THE GUIDE CODE. It is present only to deal with the 12 NUMBER_OF_PIXELS variable being undefined in this pseudo-code. As you will be updating the variable 13 in the guide, you will not need the pylint: disable. 14 15 For example: 16 If you are using a QT Py, change NUMBER_OF_PIXELS to 1. 17 If using a Neo Trinkey, change NUMBER_OF_PIXELS to 4. 18 """ 19 # pylint: disable=undefined-variable 20 21 import time 22 import board 23 import neopixel 24 25 pixel = neopixel.NeoPixel(board.NEOPIXEL, NUMBER_OF_PIXELS) 26 27 while True: 28 pixel.fill((255, 0, 0)) 29 time.sleep(0.5) 30 pixel.fill((0, 0, 0)) 31 time.sleep(0.5)