Take your QT Py and plug it into your computer via a known good data + power USB cable. Your operating system will show a drive named CIRCUITPY when a board is plugged in. If you get a drive named QTPY_BOOT you'll likely need to install CircuitPython.

The QT Py with the SPI flash memory chip is called the "QT Py Haxpress" and uses different CircuitPython firmware from CircuitPython.org if you need to reflash it.

Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit QT Py M0 Haxpress with samd21e18

Installing Project Code

To use with CircuitPython, you need to first install a few libraries, into the lib folder on your CIRCUITPY drive. Then you need to update code.py with the example script.

Thankfully, we can do this in one go. In the example below, click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, open the directory QTPy_Heart/ and then click on the directory that matches the version of CircuitPython you're using and copy the contents of that directory to your CIRCUITPY drive.

Your CIRCUITPY drive should now look similar to the following image:

CIRCUITPY
# SPDX-FileCopyrightText: 2021 Noe Ruiz for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import board
import neopixel
from adafruit_led_animation.animation.pulse import Pulse
from adafruit_led_animation.color import RED

# Update to match the pin connected to your NeoPixels
pixel_pin = board.D1
# Update to match the number of NeoPixels you have connected
pixel_num = 6

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.5, auto_write=False)

pulse = Pulse(pixels, speed=0.01, color=RED, period=1)

while True:
    pulse.animate()

This guide was first published on Feb 09, 2021. It was last updated on Jul 16, 2024.

This page (Code) was last updated on Jul 16, 2024.

Text editor powered by tinymce.