Skip to content

Instantly share code, notes, and snippets.

@jaylandro
Created February 20, 2022 00:21
Show Gist options
  • Save jaylandro/fb59acec29823016bdb88fb4678a5233 to your computer and use it in GitHub Desktop.
Save jaylandro/fb59acec29823016bdb88fb4678a5233 to your computer and use it in GitHub Desktop.
Qtpy simple blink example circuit python
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
Blink example for boards with ONLY a NeoPixel LED (e.g. without a built-in red LED).
Includes QT Py and various Trinkeys.
Requires two libraries from the Adafruit CircuitPython Library Bundle.
Download the bundle from circuitpython.org/libraries and copy the
following files to your CIRCUITPY/lib folder:
* neopixel.mpy
* adafruit_pypixelbuf.mpy
Once the libraries are copied, save this file as code.py to your CIRCUITPY
drive to run it.
"""
import time
import board
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 1)
while True:
pixels.fill((255, 0, 0))
time.sleep(0.5)
pixels.fill((0, 0, 0))
time.sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment