This code example uses the FastLED library, and is modified from a sketch called DesignerPalettes by Mark Kriegsman.
It's a great idea to get your software all set up and loaded onto your board right away, to make testing your connections easier later on.
To get the code running you'll need:
- Arduino IDE (1.8 or newer)
- Adafruit Board support for QT Py
- Arduino libraries: FastLED, Adafruit_NeoPixel
1. Arduino IDE
If you’re not using a recent version of the Arduino IDE, this would be a good time to upgrade. If this is your first time using Arduino, head over to this guide to get it installed. It's free and fairly simple to get set up.
2. Board Support
You'll need to tell the Arduino IDE which board you're using. This takes just a few minutes of setup, and you'll only need to do it once.
3. Libraries
Both libraries can be installed using the Arduino Library Manager — use Sketch → Include Library → Manage Libraries… and search for all or part of the library’s name, then click “Install.”
Look for:
FastLED
Adafruit_NeoPixel
Adafruit_NeoPixel
isn’t absolutely required for this project, but it’s handy to have installed in case you have problems with FastLED. Troubleshooting the basics is a little easier with Adafruit_NeoPixel
.
Upload the Code
Get the code by clicking "Download Project Zip" in the code listing below. Unzip the code into your Arduino project folder.
Plug your microcontroller into your computer with a USB cable. In the Arduino IDE, go to File -> Open to open the code file. Go to Tools -> Boards and select the name of the board: Adafruit QT PY (SAMD21). Then go to Tools -> Port and select the board there too. (If it's not showing up there, be sure your microcontroller is plugged into your computer via USB).
Temporarily unable to load content:
Text editor powered by tinymce.