# Adafruit Sparkle Motion Mini

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/134/626/medium800/adafruit_products_6160-04.jpg?1737650589)

Info: We mainly recommend this board for use with WLED, but examples are included in this guide for CircuitPython and Arduino.

The&nbsp; **Adafruit Sparkle Motion Mini** &nbsp;is part of our&nbsp;series of "Sparkle Motion" boards, that are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid,&nbsp;[firepixie](https://learn.adafruit.com/u/firepixie) makes a lot of projects with WLED and she loves it! So how can we make something that will be powerful enough to drive advanced LED projects that need a compact design?

![](https://cdn-learn.adafruit.com/assets/assets/000/134/627/medium800/adafruit_products_6160-01.jpg?1737650637)

The&nbsp; **Mini** &nbsp;version of the Sparkle Motion is a simpler version of our full-featured Sparkle Motion, we give up the high voltage support and built in IR receiver, in order to make it under 1 square inch in size! By using a 4-layer board and double-sided assembly we've put together this feature set:

- **Power via USB Type C for up to 5V 4A input -&nbsp;** you can use off-the-shelf USB battery packs for portable operation.
- **4&nbsp;Amp resetting fuse&nbsp;** to protect from over-current drive
- **ESP32** &nbsp;mini module with built in antenna port - the classic ESP32 has the best WLED support even if we'd prefer the 'S2 or 'S3. Comes with 4 MB of flash, dual core 240MHz Tensilica, WiFi, Bluetooth LE and Bluetooth Classic support.
- **USB-serial converter&nbsp;** with auto-reset
- **Two output signals plus 5V power and ground** &nbsp;- both signal output are level shifted to 5V. These are on 0.1" spaced breakout pads. To keep the design slim we don't include terminal blocks pre-soldered,&nbsp;[but we do stock the matching blocks if you want them](https://www.adafruit.com/product/2137)
- **Extra 2x3 0.1" breakout pads** &nbsp;with&nbsp;4&nbsp;more GPIO plus 3V power and ground.
- **Built-in I2S microphone type SPH0654**
- **Stemma QT I2C port** &nbsp;to connect external sensors/OLED/etc
- **User button on GPIO 0** &nbsp;plus Reset button
- **Red built-in LED** &nbsp;on pin 12
- **Small built-in NeoPixel** &nbsp;on pin 18&nbsp;
- **Separate analog/digital input JST port&nbsp;** for analog input, potentiometer, microphone or external&nbsp;IR receiver on pin 13
- **Compact enough you can use it for wearable projects** &nbsp;- 1.2"x0.8" / 30mm x 20mm size with mounting holes

![](https://cdn-learn.adafruit.com/assets/assets/000/134/628/medium800/adafruit_products_6160-02.jpg?1737650645)

While we recommend it for use with WLED, it will also work just fine as a compact ESP32 board for use with Arduino, ESP-IDF, MicroPython, CircuitPython or any other ESP32 supported codebase.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/134/630/medium800/adafruit_products_6160-03.jpg?1737650669)

Note that unlike the classic Sparkle Motion board,&nbsp;we don't include terminal blocks pre-soldered to keep the board very slim.&nbsp;[We do stock the matching blocks if you want them](https://www.adafruit.com/product/2137), a small amount of soldering is required to attach them. Also, unlike the bigger version, we dropped the on-board IR receiver - however its easy to add one by&nbsp;[plugging in a JST SH 3-pin socket cable](https://www.adafruit.com/product/5755)&nbsp;and&nbsp;[slotting in an IR receiver module](https://www.adafruit.com/product/157).

# Adafruit Sparkle Motion Mini

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/134/509/medium800/adafruit_products_pinouts_frontback.jpg?1737121008)

The Adafruit Sparkle Motion Mini is a miniature board with a lot of sparkly features. This page covers it all!

![](https://cdn-learn.adafruit.com/assets/assets/000/134/646/medium800/adafruit_products_Artboard_1.png?1737677175)

PrettyPins PDF [on GitHub](https://github.com/adafruit/Adafruit-Mini-Sparkle-Motion-PCB/blob/main/Adafruit%20Mini%20Sparkle%20Motion%20PrettyPins.pdf).

## Power Pins
![](https://cdn-learn.adafruit.com/assets/assets/000/134/517/medium800/adafruit_products_pinouts_power_v2.png?1737125327)

- **USB-C port** - This is used for both powering and programming the board. You can power it with any USB C cable. It is a 5V 4A input - you can use off-the-shelf USB battery packs for portable operation. It is connected to a 4 Amp resetting fuse to protect from over-current drive.
- **5V** - This pin, located in the bottom right corner of the board, is the output from the 5V regulator. Its meant to power your 5V pixels.
- **Power LED** - The green LED, located in the bottom right corner on the front of the board, indicates when the board is powered up.
- **G** - This is the common ground for all power and logic.
- **3.3V** - This pin, located in the top right corner of the board, is the output from the 3.3V regulator. It can supply 500mA peak.

## ESP32 Module
The processor on the Sparkle Motion Mini is an **ESP32 mini module**. The classic ESP32 has the best WLED support. Comes with 4 MB of flash, dual core 240MHz Tensilica, WiFi, Bluetooth LE and Bluetooth Classic support.

![adafruit_products_pinouts_mcu.png](https://cdn-learn.adafruit.com/assets/assets/000/134/526/medium640/adafruit_products_pinouts_mcu.png?1737146960)

## NeoPixel Output Signals
![](https://cdn-learn.adafruit.com/assets/assets/000/134/511/medium800/adafruit_products_pinouts_led_data.png?1737122932)

On the right edge of the board are two NeoPixel output signals. Both signals are level shifted to 5V and are on 0.1" spaced breakout pads.

- **32** - GPIO32, available as **D32** in CircuitPython and **32** in Arduino
- **33** - GPIO33, available as **D33** in CircuitPython and **33** in Arduino.

## Logic Pins
![](https://cdn-learn.adafruit.com/assets/assets/000/134/527/medium800/adafruit_products_logic.jpg?1737147831)

The Sparkle Motion Mini has 4 general purpose "IO" pins broken out near the top of the board and 1 additional GPIO available via the 3-pin **JST port** at the bottom edge of the board.

- **14** - GPIO14. It uses ADC2. One of the capacitive touch pins. Available as **D14** in CircuitPython and **14** in Arduino.
- **27** - GPIO27. It uses ADC2. One of the capacitive touch pins. Available as **D27** in CircuitPython and **27** in Arduino.
- **25** - GPIO25. This is the UART **TX** (transmit) pin. Connect to the RX pin found on a breakout or device. This is separate than the 'debug UART' which is connected to the USB-to-Serial converter, so it will not interfere during upload. In Arduino, use `Serial1`. In CircuitPython, use `board.TX`.
- **26** - GPIO26. This is the UART **RX** (receive) pin. Connect to the TX pin found on a breakout or device. This is separate than the 'debug UART' which is connected to the USB-to-Serial converter, so it will not interfere during upload. In Arduino, use `Serial1`. In CircuitPython, use `board.RX`.
- **13 / JST port** - GPIO13. It uses ADC2. One of the capacitive touch pins. Available as **D13** or **A0** in both CircuitPython and Arduino.

Note you cannot read analog inputs on **ADC2** once WiFi has started, as it is shared with the WiFi hardware.

## STEMMA QT
![](https://cdn-learn.adafruit.com/assets/assets/000/134/516/medium800/adafruit_products_pinouts_stemma_qt.png?1737123232)

This **JST SH 4-pin [STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) connector** breaks out I2C (SCL, SDA, 3.3V, GND). It allows you to connect to [various breakouts and sensors with **STEMMA QT** connectors](https://www.adafruit.com/category/1018) or to other things using&nbsp;[assorted associated accessories](https://www.adafruit.com/?q=JST%20SH%204). It works great with any STEMMA QT or Qwiic sensor/device. You can also use it with Grove I2C devices thanks to [this handy cable](https://www.adafruit.com/product/4528).

- **SCL** - GPIO22
- **SDA** - GPIO19

You can access this I2C port with `board.STEMMA_I2C()` in CircuitPython and `Wire` in Arduino.

## NeoPixel and Red LED
![](https://cdn-learn.adafruit.com/assets/assets/000/134/529/medium800/adafruit_products_leds.jpg?1737148468)

There are two LEDs you can control in code.

- **NeoPixel LED** - This addressable RGB NeoPixel LED, labeled **Neo** on the board, can be controlled with code. It acts as a status LED in CircuitPython and is connected to GPIO18.&nbsp;It is available in CircuitPython as `board.NEOPIXEL`, and in Arduino as `PIN_NEOPIXEL`.
- **Red LED** - This little red LED, labeled **12** on the board, is on or blinks during certain operations (such as pulsing when in the bootloader), and is controllable in code. It is available in CircuitPython as `board.LED`, and in Arduino as `LED_BUILTIN` or `12`.

## Buttons
![](https://cdn-learn.adafruit.com/assets/assets/000/134/514/medium800/adafruit_products_pinouts_boot_reset.png?1737123004)

There are two buttons on the Sparkle Motion Mini

- **Reset button** - This button restarts the board and helps enter the bootloader. You can click it once to reset the board without unplugging the USB cable or battery.&nbsp;
- **Boot button** - This button can be read as an input in code. It is connected to pin **GPIO0**. It is available as `board.BUTTON` in CircuitPython, and `BUTTON` in Arduino. Simply set it to be an input with a pullup. This button can also be used to put the board into&nbsp;_ROM bootloader mode_. To enter ROM bootloader mode, hold down boot button while clicking reset button mentioned above. When in the ROM bootloader, you can upload code and query the chip using `esptool`.

## I2S Microphone
![](https://cdn-learn.adafruit.com/assets/assets/000/134/515/medium800/adafruit_products_pinouts_mic.png?1737123103)

In the bottom left corner of the board is an I2S microphone, great for adding audio reactivity to your WLED projects. It uses three data pins:

- **DATA** - GPIO9
- **WS** - GPIO10
- **BCLK** - GPIO23

You can use the microphone with WLED and Arduino. There is no I2S input support in CircuitPython at this time.

## CH343 USB-to-Serial Converter
![](https://cdn-learn.adafruit.com/assets/assets/000/134/518/medium800/adafruit_products_pinouts_serial_converter.png?1737125344)

The **CH343 USB to serial converter** communicates between the ESP32 and your computer over USB. It is a full-speed USB device interface and is USB 2.0 compatible. It has an auto-reset circuit that works perfectly with any ESP32 uploading tool. Sometimes these chips require drivers to be installed on your computer's operating system. We have a [Learn Guide detailing how to install these drivers.](https://learn.adafruit.com/how-to-install-drivers-for-wch-usb-to-serial-chips-ch9102f-ch9102)

# Adafruit Sparkle Motion Mini

## Connecting LEDs

### Wiring Diagram
![](https://cdn-learn.adafruit.com/assets/assets/000/134/683/medium800/adafruit_products_sparklemini_wiring.jpg?1737742699)

There are many different types of pixels available. This is a general reference that shows connection points for most types of strips. Your project may have different requirements, but this is a good starting point.

For Dotstar strips or other strips that have 4 solder pads, use pins 32 and 33 as CLK and Data.

For NeoPixel strips or other strips that have 3 solder pads or wires, use either GPIO pin for your Data line, or use both to run two instances at the same time. The 5v and G pins are shared with both strips.

The two JST-SH connector ports can be used to connect sensors or other peripherals.

### How many LEDs Can I Connect?

The Sparkle Motion Mini board has two outputs for LED strips using the GPIO pins. It has a "Classic" ESP32 chip onboard. The board will handle up to 4A draw from the pixels.&nbsp;

Here is a guide giving more info on what that means in terms of power draw: [Powering NeoPixels Guide](https://learn.adafruit.com/adafruit-neopixel-uberguide/powering-neopixels). The power draw varies greatly depending on the type of pixels and the brightness, as well as the color choice.&nbsp;

### Estimating Power Requirements

Each individual NeoPixel draws up to ~60 milliamps at maximum brightness white (red + green + blue). In actual use though, it’s rare for all pixels to be turned on that way. When mixing colors and displaying animations, the current draw will be much less. It’s impossible to estimate a single number for all circumstances, but we’ve been using 1/3 this (20 mA per pixel) as a gross rule of thumb with no ill effects. But if you know for a fact that you need every pixel on at maximum brightness, use the full 60 mA figure.  
  
To estimate power supply needs, multiply the number of pixels by 20, then divide the result by 1,000 for the “rule of thumb” power supply rating in Amps. Or use 60 (instead of 20) if you want to guarantee an absolute margin of safety for all situations. For example:  
  
60 NeoPixels × 20 mA ÷ 1,000 = 1.2 Amps&nbsp;  
60 NeoPixels × 60 mA ÷ 1,000 = 3.6 Amps  
  
The choice of “overhead” in your power supply is up to you. Maximum safety and reliability are achieved with a more generously-sized power supply, and this is what we recommend. Most power supplies can briefly push a little extra current&nbsp;<u>for short periods</u>. Many contain a thermal fuse and will simply shut down if overworked. So they may technically&nbsp;_work,_&nbsp;but this is the electronics equivalent of abusing a rental car.

**Keep in mind, 60 mA is a&nbsp;_worst case_&nbsp;estimate! We’ve written a whole separate tutorial&nbsp;on getting things under control:&nbsp;[Sipping Power with NeoPixels](https://learn.adafruit.com/sipping-power-with-neopixels).**

**Also, keep in mind that WLED has a built in 'current limiting' software regulator that will dim the LEDs to keep them within your max power supply: that way your designs will be as bright as they can be for the power availability without having to do a ton of math**

### Driving Pixels with WLED

[From the WLED Knowledge base:](https://kno.wled.ge/features/multi-strip/)

> For perfect performance, it is recommended to use 512 LEDs/pin with 4 outputs for a total of 2048 LEDs.  
> For very good performance, it is recommended to use 800 LEDs/pin with 4 outputs for a total of 3200 LEDs.  
> For good performance, you can use 1000 LEDs/pin with 4 outputs for a total of 4000 LEDs.  
> For okay performance, you can use 1000 LEDs/pin with 5 outputs for a total of 5000 LEDs.  
> For okay performance, you can use 800 LEDs/pin with 6 outputs for a total of 4800 LEDs.  
> ESP32 can calculate about 65k-85k LEDs per second (that means 1000 LEDs @~70fps, 2000 LEDs @~35fps, 4000 LEDs @~18fps)  
> 4 outputs seem to be the sweet spot.

This board has two outputs intended for attaching LED strips, and you could wire up a third if you're clever and use one of the other GPIO pins. But if you've got a large-scale project, consider the [Sparkle Motion](https://www.adafruit.com/product/6100) board instead. It's set up with 4 outputs and a bit more power.

### What Kind of LEDs Can I Use?

The Sparkle Motion Mini board and WLED accept a wide variety of pixel types. Anything in the Adafruit store labeled as "NeoPixel" or "Dotstar" will work. You can use rings, strips, jewels, pebble pixels, stars, RGBW strips, or just about any RGB [addressable pixels you can find in our shop](https://www.adafruit.com/category/168).

This setup will NOT work with "dumb" RGB strips or analog strips. It's meant for strips with individually addressable pixels (strips where each pixel can become a different color) rather than the strips that can only show one color at a time.

### How Do I Power It?

For wearable or portable projects you can use a [USB battery](https://www.adafruit.com/product/1566) or a [USB Power Supply](https://www.adafruit.com/product/5802) that's rated for up to 4A, plugged into the onboard USB-C port.&nbsp;

### A Word About Connectors

It's possible to direct-wire your LED strips or pixels into the pins on the Sparkle Motion Mini, but I find it easier and more convenient to use [3-pin JST connectors](https://www.adafruit.com/product/1663) that can be permanently affixed to the board with strain relief so they don't pull out. Then I can simply plug in whatever LED strip or strand I want to use.

LED strips often come with these connectors already attached, but there seems to be no standard for whether the factories attach the male or the female connector on the "in" end. For my own peace of mind, I try to be consistent and always use the male side of the connectors on the microcontrollers, and the female on the "in" end of my LED strip. Data is flowing "out" from the microcontroller and "in" to the strip, so the male/female metaphor makes good sense in this arrangement.&nbsp;

There is also no standard as to which way the color coding is wired on these connectors. Some have a red wire on the left side, some on the right side. Some have no color coding at all. Hooking your strips up "backwards" (accidentally connecting a red wire to a black wire) can damage your board and your LEDs, so it's important to be really careful when you're setting up your connectors. Be as consistent as possible with color coding and throw away any connectors you've got in the drawer that are wired "backwards" from the rest.&nbsp;

For one LED strip: Connect your red or rightmost connector wire to +5v, your middle wire to either 32 or 33, and the black / rightmost wire to G.

If you're connecting DotStar strips, use 32 and 33 as your data and clock wires.

![adafruit_products_10_mini_oneconnector.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/577/medium640/adafruit_products_10_mini_oneconnector.jpg?1737504016)

To connect two strips, use two male connectors. Splice the red and black wires together, adding a third wire to connect to the board. Leave the two center data wires separate -- in the photo you can see that I added some longer wires so all 4 wires going to the board are the same length.

Connect the red wire to 5v, the data wires to 32 and 33, and the black wire to G.

![adafruit_products_2_connectors.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/592/medium640/adafruit_products_2_connectors.jpg?1737570937)

![adafruit_products_IMG_8187.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/593/medium640/adafruit_products_IMG_8187.jpeg?1737570955)

Connect the female side of the JST connector to your LED strip or strand, making sure the wire order matches the male connector in your screw terminal: +5v (red) should match up to +, data IN to GPIO, and G to G. Plug in your strand. If you've already installed the software and set up your pins, the lights should come on when you plug the USB port into power.

![adafruit_products_led_strips.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/575/medium640/adafruit_products_led_strips.jpeg?1737503181)

# Adafruit Sparkle Motion Mini

## WLED Setup

The following pages will walk you through installing WLED, setting up the various features within the software and getting your lights turned on and responding to sound or IR control. We'll also show you how to connect sensors via the onboard Stemma port and add button control. And, we'll show you how to set up multiple strands and multiple controllers and sync them together for larger scale projects.

Ready? Set? Let's go.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/467/medium800/adafruit_products_wled_interface.jpg?1736880807)

# Adafruit Sparkle Motion Mini

## WLED Software

## Board Choices

WLED runs on several different boards in Adafruit's collection. There are different benefits to each, but the installation process is largely the same. This page contains instructions for multiple boards -- be sure to use the pinouts and installation instructions for the one you're using,

**Sparkle Motion**

This is our flagship ESP32 board, designed with WLED and Xlights in mind. It has 4 outputs and is set up to drive either 5v, 12v or 24v pixels. It's a workhorse of a board and for larger projects it's the clear winner. It has an onboard microphone for instant sound-reactive support, and an IR sensor built in, to make it easy to control your project with an infrared remote. It also has a couple stemma ports so you can add your own sensors or peripherals.

**Sparkle Motion Mini**

The Sparkle Motion Mini is a smaller version of the Sparkle Motion board. It has two LED outputs, a microphone, and two stemma ports that make it easy to add an IR sensor or other peripherals. It's got an onboard NeoPixel and a small footprint, making it perfect for wearables or smaller projects. It will power a whole lot of pixels through the onboard USB port: it's safe to draw up to 4A through this port, giving you plenty of power for most wearable projects.

Info: For Sparkle Motion Mini use at least the 0.15.1 release of WLED.

 **QT Py Pico ESP32**

The [QT Py Pico](https://www.adafruit.com/product/5395) is small and affordable, so usually my go-to for smaller costumes or wearables. It also has a range of BFF add-on boards that add functionality.&nbsp;[Here's a guide with more QT Py info](https://learn.adafruit.com/adafruit-qt-py-esp32-pico/overview). The QT Py will drive up to around 30 pixels through the onboard USB port, so if you have more LEDs than that you may want to consider the Sparkle Motion Mini instead, or you can power the board through the +5v pin.

Note: WLED works on the QT Py Pico but NOT on the S2 or S3 versions, at the time of writing.

**Feather Huzzah ESP32&nbsp;**

The [Feather Huzzah ESP32](https://www.adafruit.com/product/3405) the top of the line. It's a great choice for projects where you want to add sensors, interaction, or drive a whole lot of LEDs. It's the most reliable as well -- I've run these for two months straight with no power cycling and they just keep on truckin. Adafruit has a very wide selection of Feather Wing boards that connect to the Feather microcontroller line. The sky is the limit with these boards.

It also comes in a version with a high-powered WiFi range extender! If you're trying to sync multiple instances across distance, check this one out. [Feather Huzzah ESP32 V2 w.FL Antenna](https://www.adafruit.com/product/5438)

**Feather Huzzah ESP8266**

The [Feather Huzzah ESP8266](https://www.adafruit.com/product/2821) will run WLED as well, but won't drive as many pixels: the ESP32 limit on WLED is around 1000 pixels per input, but the ESP8266 tops out at around 500. It's about $5 cheaper though, so for smaller projects it's a great way to save a little money and still have access to all the Featherwing options in the Adafruit store.

## Driver Update

Some versions of our controllers have a new serial chip which needs a driver installed before we can install WLED. Head over to our&nbsp;[How to Install Drivers for WCH USB to Serial Chips](https://learn.adafruit.com/how-to-install-drivers-for-wch-usb-to-serial-chips) tutorial, and download and install the new driver.

If you have an older QT Py with CP2102 USB-to-Serial bridge, [use SiLabs’ driver instead](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads).

&nbsp;

## Install WLED

These next steps require a **_Web Serial_-compatible browser**. As of this writing, that means **Google&nbsp;Chrome** , **Microsoft&nbsp;Edge** or **Opera** &nbsp;“desktop” browsers. Other browsers (Safari, Firefox, Explorer and _anything_ mobile) won’t work.

Visit [https://install.wled.me/](https://install.wled.me/)

Plug your microcontroller into your computer with a known good USB cable. Click "Install" and select the port for your board.

Depending on the USB-to-serial bridge chip on the board, you might see one _or two_ serial ports. On Mac, for instance, there might be both “/dev/cu.usbmodem[number]” _and_ “/dev/cu.wchusbserial[number]”. Use the “ **wchusbserial** ” one.

![adafruit_products_Install_WLED.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/287/medium640/adafruit_products_Install_WLED.jpg?1663802069)

After successful installation, enter your WiFi network name and password when prompted. This must be a **2.4 GHz** WiFi network; ESP32 does not support 5 GHz networks. If it can’t connect, then as a fallback WLED will create its own 2.4 GHz WiFi access point.

![led_strips_Install_WLED.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/601/medium640/led_strips_Install_WLED.jpg?1737574345)

Danger: Sometimes the "Connect to Wi-Fi" prompt doesn't show up. Don't panic, just see the step below on connecting your computer or mobile device to the WLED-AP access point created on the microcontroller itself!

If you don't see the "Connect to Wi-Fi" prompt, you'll need to set up your WiFi network using AP (access point) mode.&nbsp;Open up your WiFi settings and look for a WiFi network called&nbsp;`WLED-AP`. (Note, this access point can take up to 30 seconds to appear sometimes.) Connect to this network&nbsp;using the default password&nbsp;`wled1234`. The WLED interface will pop up in its own captive browser window.

From here, go into **Config/Wifi Settings** and enter your WiFi credentials for the access point you normally use near the top.

Give your project a name in the mDNS field a little further down the page. Now you can type in "projectname.local" (where "projectname" is your mDNS name) into any web browser on the same wifi network to access your microcontroller.

You can also scan the QR code below to open access point mode.&nbsp;

For more help and troubleshooting tips visit the [Getting Started page on the WLED knowledge base.](https://kno.wled.ge/basics/getting-started/)

![led_strips_install_no_wifi.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/597/medium640/led_strips_install_no_wifi.jpg?1737574050)

![](https://cdn-learn.adafruit.com/assets/assets/000/136/104/medium640/led_strips_Screenshot_2025-03-31_at_9.39.02%E2%80%AFAM.jpg?1743439611)

![led_strips_WLED_wifi_settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/598/medium640/led_strips_WLED_wifi_settings.jpg?1737574103)

![](https://cdn-learn.adafruit.com/assets/assets/000/134/599/medium800/led_strips_WLED-QR-Connect-WB.png?1737574151)

## Setup & Preferences
### WiFi&nbsp;Setup

Head to the **WiFi Setup** screen under Config and create a good URL so you can control your project from any web-enabled device. Call it something you'll remember, that's easy to type into any web browser on your WiFi network in order to connect to your project.

In Safari or Chrome on your phone or computer, type in this web address to access the WLED interface: [http://projectname.local](http://projectname.local)&nbsp; (where "projectname" is whatever you put into this field).

Check out the Additional Settings page for more info on accessing your project. WLED has an "access point mode" that doesn't require a WiFi network for when you're out on the go. It's also helpful to download one of the WLED apps to help manage and organize your projects.

![adafruit_products_wled_config.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/288/medium640/adafruit_products_wled_config.jpg?1663802411)

![led_strips_adafruit_products_WiFi_Settings_generic.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/679/medium640/led_strips_adafruit_products_WiFi_Settings_generic.jpg?1722624553)

### LED Preferences

Next, head to the **LED Preferences** tab under the Config menu.

Scroll down to&nbsp; **Hardware Setup**. Put your total number of LEDs into the "Length" field, and change GPIO to the pin number associated with the pin you soldered to. Check the pinout diagram for the board you're using (it's the number in yellow).

- [Sparkle Motion Pinout](https://learn.adafruit.com/adafruit-sparkle-motion)
- [Sparkle Motion Mini Pinout](https://learn.adafruit.com/adafruit-sparkle-motion-mini/overview)
- [QT Py Pico Pinout](https://learn.adafruit.com/assets/112309)&nbsp;
- [Feather Huzzah ESP8266 Pinout](https://learn.adafruit.com/assets/46249)&nbsp;
- [Feather Huzzah ESP32 Pinout](https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/pinouts)

![led_strips_led_settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/680/medium640/led_strips_led_settings.jpg?1722624626)

## Use It
![adafruit_products_WLED_interface.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/394/medium800/adafruit_products_WLED_interface.jpg?1667150591)

Now you can use any computer or handheld device to control your LEDs.&nbsp;

Make sure your device is on the same WiFi network as your board. Navigate to your custom URL (projectname.local/ ) in a web browser. You'll see a color picker above a whole bunch of color palette choices.

Choose a color, choose an effect, and watch your lights animate and glow!

Save your favorite combinations as presets, create playlists, control the speed and intensity of the animations, and lots more. This web app is incredibly intuitive and easy to use.

Head over to the WLED wiki at [https://kno.wled.ge/](https://kno.wled.ge/) to delve into all the particulars.

# Adafruit Sparkle Motion Mini

## WLED Config

Next we'll tell WLED about our physical setup. We'll give our project a name and easy-to-remember URL, and tell the software how many LEDs we have set up on each pin.

### WiFi&nbsp;Setup

Head to the **WiFi Setup** screen under Config. This is where your network credentials live, so you can change them if needed. Scroll down to the mDNS field and create a good URL so you can control your project from any web-enabled device. Call it something you'll remember, that's easy to type into any web browser on your WiFi network in order to connect to your project.&nbsp;

In this example, I'd go to my web browser on my phone, ipad, or computer, and type in "http://projectname.local" to open up the WLED interface on my screen.&nbsp; Your device must be on the same WiFi network as your board.

![adafruit_products_wled_config.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/288/medium640/adafruit_products_wled_config.jpg?1663802411)

![led_strips_adafruit_products_WiFi_Settings_generic.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/679/medium640/led_strips_adafruit_products_WiFi_Settings_generic.jpg?1722624553)

Warning: Before using GPIO 32 for data, you need to deselect it from the microphone configuration. See this [GitHub issue for reference](https://github.com/wled/WLED/issues/4501).

### LED Preferences

Next, head to the **LED Preferences** tab under the Config menu.

Scroll down to&nbsp; **Hardware Setup**. The Sparkle Motion Mini board has 2 outputs to attach LED strips: GPIO pins 32 and 33.

WLED allows up to 3 strips to be connected at once. The strips can be of different types, lengths, and color order. Select your LED type, length, and GPIO pin. If you have multiple strips connected, click the + button and enter the additional strips in the same way.&nbsp;

![adafruit_products_LED_Settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/602/medium640/adafruit_products_LED_Settings.jpg?1737575535)

Click "save" and if you've done everything correctly, your light strands should come on in a warm, cheerful yellow color. Success! Time to start making pretty light animations.&nbsp;

## Troubleshooting

_If your lights didn't come on, here are a few things to try:_

1. Head back to WLED and check your pinout configuration under LED Preferences. Be sure the pin number is the correct GPIO for the attachment point you used.
2. Check your wiring! Be sure you connected to the IN end of the LED strip. These strips can be inconsistent so this is a pretty common problem. Use an [alligator clip](https://www.adafruit.com/product/1008) to try connecting the data wire on the other end (the power and ground wires should work from either end).
3. Try re-uploading the WLED software.&nbsp;
4. If the lights come on but you can't control them: i.e. you type in "projectname.local" into your browser and it won't connect, make sure you're on the correct WiFi network. If you're on a different network than the one you set up the sofware on, you won't see the WLED connection.
5. If your lights came on in blue or green instead of yellow, your color order is wrong. See below to fix.
6. If only half your lights came on, be sure you've got the correct number in the "length" field under LED preferences.
7. If your lights came on in a variety of weird colors and looking like a 1950s diner interior, you may have the wrong LED strip type selected. RGBW strips and RGB strips are not the same, so be sure you've got the correct strip type or you'll get very odd behavior.
8. If your microcontroller hangs or keeps rebooting, or gets really hot, you may have the power and ground lines switched. Unplug right away and check: this is a fast way to brick your controller.

## Color Order
If your lights have come on in any color other than a warm yellow, there's one more setting to change. LED strips and pixels are not all standardized, and sometimes the red, green, and blue LEDs inside are connected in a different order.&nbsp;

In the main interface window, choose "solid" as your effect and red as your color from the color picker.&nbsp;

If your lights come on in any color other than red, your color order is set incorrectly. This is an easy fix. Head back to the LED settings tab and find the Hardware Setup section (this is where you set up your pin number earlier). Choose BRG from the dropdown, click save, and see if your pixel colors match your color picker now. If not, try another combo until the lights look correct.

![adafruit_products_15_rgb_order1.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/448/medium640/adafruit_products_15_rgb_order1.jpeg?1736806444)

![adafruit_products_16_rgb_order2.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/449/medium640/adafruit_products_16_rgb_order2.jpeg?1736806608)

# Adafruit Sparkle Motion Mini

## IR Remote Setup

Adding infrared control to your project is easy. WLED comes preprogrammed to use a variety of common IR remote controls, so you can get instant functionality with just a little bit of setup.

The Sparkle Motion Mini board doesn't have an onboard sensor, but it's easy to add one via the stemma port. The 3-pin stemma port uses GPIO 13, and the 4-pin uses GPIO 19 (yellow wire) and 22 (blue wire).&nbsp;

## Adding a Wired IR Sensor
You'll need an [IR sensor](https://www.adafruit.com/product/157) and a [STEMMA JST 3-pin connector](https://www.adafruit.com/product/3894) with female sockets. Plug the connector into the smaller of the two stemma ports. Looking at the sensor with the bump facing you:

- White wire on the left
- Black wire in the middle
- Red wire on the right

You can lengthen the wires as needed so your IR sensor ends up right where you want it.&nbsp;

We also have these handy [IR breakout boards available](https://www.adafruit.com/product/5939).

![adafruit_products_ir_mini.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/603/medium640/adafruit_products_ir_mini.jpeg?1737576043)

Click the LED Preferences tab and scroll down to Hardware Setup.

Change the IR GPIO pin to match the pin you're using, and select which remote you're using from the dropdown. I like this&nbsp;[44 key remote](https://a.co/d/goUSZzu) since it gives me quick full-strip color control as well as plenty of customizable buttons to use with my different presets.

![adafruit_products_ir_settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/604/medium640/adafruit_products_ir_settings.jpg?1737576638)

## Remote Usage: 44 Key Remote

Change the brightness or turn the strip on and off with the buttons on the top row.

When you have the "solid" effect selected in WLED, the color buttons near the top of the remote will change the colors, making the pixels act like a "dumb" RGB strip.&nbsp;

On my 44-key remote, there are buttons near the bottom labeled "DIY1", "DIY2" etc. WLED will automatically assign your animation presets to these buttons so you can select your favorite presets or playlists. Simply save the presets you want to the first 6 preset slots and the buttons will pull them up.&nbsp;

Head over to the WLED wiki at [https://kno.wled.ge/](https://kno.wled.ge/) to delve into all the particulars.

# Adafruit Sparkle Motion Mini

## WLED 2D Matrix

If you're using a 2-dimensional matrix, such as an LED curtain or net, WLED has a handy 2D-matrix setup feature that will take care of the mapping for you. Head to Config and choose the **2D Configuration** tab.

Check out these tutorials for more about 2d mapping with WLED:

- [Monster Matrix](https://learn.adafruit.com/Monster-Matrix-with-WLED)
- [LED Festival Coat](https://learn.adafruit.com/led-festival-coat-with-mapping-and-wled)
- [Sound Reactive Top Hat](https://learn.adafruit.com/sound-reactive-led-top-hat)
- [Sparkle Skirt 2D](https://learn.adafruit.com/sparkle-motion-skirt-with-2d-mapping/)

Change the dropdown to read 2d Matrix, and additional options will appear. If you want to sync more than one panel, you can do it here.&nbsp;

Set up your layout numbers to match the number of rows and columns in your project. You can also change orientation here - my pixels start in the lower left corner and finish in the upper right.

![adafruit_products_2D_Set-up.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/567/medium640/adafruit_products_2D_Set-up.jpg?1707334430)

![adafruit_products_2D_Set-up_matrix.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/568/medium640/adafruit_products_2D_Set-up_matrix.jpg?1707334492)

## Matrix Effects

WLED has a hefty number of matrix effects that appear in the list when you've got your 2d matrix set up.&nbsp; Many of them can be customized with speed and intensity sliders, or different color palettes. Go wild!&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/127/569/medium800/adafruit_products_matrix_effects.jpg?1707334830)

# Adafruit Sparkle Motion Mini

## WLED Audioreactive Setup

The Sparkle Motion Mini board comes with an onboard PDM microphone, so adding audio reactivity to your project is easy. Here's how to get it set up.

Click&nbsp; **Config** &nbsp;and then select the&nbsp; **Usermods** &nbsp;tab.

![usermods highlighted in the menu](https://cdn-learn.adafruit.com/assets/assets/000/136/524/medium640/wled_audioreactive_setup_adafruit_products_image.png?1745943834)

Scroll down a bit and you'll find the&nbsp; **AudioReactive** &nbsp;section.

Click the box to enable, then enter the settings and the Digitalmic section as follows:

- Type: **SPH0654**
- Pin I2S SD: **9**
- Pin I2S WS: **10**
- Pin&nbsp;I2S SCK: **23**

The other pins are unused.

**Reboot your Sparkle Motion Mini for changes to take effect.**

![the audioreactive menu](https://cdn-learn.adafruit.com/assets/assets/000/136/530/medium640/adafruit_products_audio_reactive.png?1745948936)

If you want the audio to work well in both loud and quiet settings, you may want to turn on **AGC** - automatic gain control. Start with **Normal** and then experiment with other options if you want more or less 'gain speed'.

![the AGC menu highlighted](https://cdn-learn.adafruit.com/assets/assets/000/136/525/medium640/wled_audioreactive_setup_adafruit_products_image_%281%29.png?1745944156)

There are a lot of other settings you can adjust in WLED. I found that the default settings for this mic seem to work perfectly, but you can delve into the particulars at [https://kno.wled.ge/advanced/audio-reactive/](https://kno.wled.ge/advanced/audio-reactive/)

To use audio reactive mode, head back to the main interface and select any effect that has a **music note icon** next to the name. You can also search for musical-reactive effects that are built in.

Make some noise and see how your lights react. If it doesn't work, check your pins, try turning on AGC, tapping on the mic, and rebooting (removing power completely, waiting a few seconds then turn back on).

![turning on audio reactive mode on the effect](https://cdn-learn.adafruit.com/assets/assets/000/136/526/medium640/wled_audioreactive_setup_adafruit_products_image_%282%29.png?1745944211)

If you happen to have a 2D matrix as an output, the GEQ effect shows a 'binned' frequency response graph which can be good for debugging!

![the GEQ option in the main menu](https://cdn-learn.adafruit.com/assets/assets/000/136/527/medium640/wled_audioreactive_setup_adafruit_products_image_%283%29.png?1745944285)

![a GEQ output on a 16x16 matrix](https://cdn-learn.adafruit.com/assets/assets/000/136/528/medium640/wled_audioreactive_setup_adafruit_products_IMG_2299.jpg?1745944316)

# Adafruit Sparkle Motion Mini

## Create Presets

### Animation Presets

Once your lights are working, it's time for the fun part: creating light animations using WLED presets. This is easy and intuitive in WLED. Choose a color palette and an effect, then play with the sliders at the bottom of the Effect Mode column to customize the effect.

When you find something you like, click the +Preset button in the Presets tab and give your preset a name, then save it. You can reorder them using the "Save to ID" field.&nbsp;

You can create hundreds of presets using the preprogrammed effects, so take some time to play around and see what looks good on your LED strip.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/540/medium800/led_strips_setup_presets.jpg?1722023074)

Create at least 3 presets, and be sure they are saved to ID numbers 1-3. Our next step will be to set up the switch to toggle between these presets.&nbsp;

## Control Presets

The WLED preset interface can also be used to send control commands to the LED strip. Once you've set up a button or switch, it can be used for a wide variety of control functions: change modes, change brightness, toggle the lights on and off, or a whole host of other features.&nbsp;

Each button function in WLED has 3 options: a short press, a long press, or a double press. I want my lights to cycle through presets with a short press, and to turn on or off with a long press. Here's how I set up a control preset for each of these features.

### Cycle through Presets
Click +Preset and then uncheck the "Use current state" checkbox. This will open up an API command window within the preset module.

Call the effect "Next\_FX" and type {"ps":"1~3~"} into the API command box. This tells WLED to cycle through presets 1-3. If you'd like to cycle through more presets, change the 3 to the number of presets you have.&nbsp;

Be sure your preset IDs include all the numbers -- skipping a number will break this command.

Give your preset an ID number that's above the range of your preset numbers -- I called mine 9.&nbsp;

![led_strips_presets_next_fx.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/545/medium640/led_strips_presets_next_fx.jpg?1722024741)

It's also possible to cycle between playlists. I made a playlist of sound reactive effects and a separate playlist of "standard" effects. I set up a preset that toggles between the two playlists -- effectively turning "sound reactive" mode on and off.

![led_strips_soundreactive_toggle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/693/medium640/led_strips_soundreactive_toggle.jpg?1722904335)

### Toggle On/Off
Create another preset and call it "Toggle". Uncheck the "use current state" checkbox and enter **T=2** into the API command box. This will tell the LEDs to toggle between on and off. Save this one to ID 10.

![led_strips_presets_toggle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/546/medium640/led_strips_presets_toggle.jpg?1722024787)

On the next page, these control presets will be connected to a button.

Find out more about creating these control presets here:&nbsp;

[https://kno.wled.ge/features/presets/](https://kno.wled.ge/features/presets/)

You can enter either JSON commands or HTTP commands into this command box, giving you a lot of control over your WLED project.&nbsp;

[https://kno.wled.ge/interfaces/json-api/](https://kno.wled.ge/interfaces/json-api/)

# Adafruit Sparkle Motion Mini

## WLED Button Setup

Adding a control button is easy with the Sparkle Motion Mini board. Any momentary switch will work. I'm using this chonky&nbsp;[12mm Tactile Switch Button](https://www.adafruit.com/product/1119) and a [STEMMA JST PH 2mm 3-Pin connector with female sockets.](https://www.adafruit.com/product/3894)

Plug the JST connector into the smaller of the two stemma ports. Straighten out the legs on one side of your button and slip the legs into the female connectors: one leg goes to white (data GPIO **13** ), the other to black ( **G** ).&nbsp;&nbsp;

It's fine to extend these wires so they're longer. For a more solid connection you can cut the connectors off and solder directly to the button legs.

![adafruit_products_button_mini.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/606/medium640/adafruit_products_button_mini.jpeg?1737577037)

I advise against using button 0. WLED's buttons have some default behaviors written in, and one of button 0's default behaviors is that when it's pressed for more than a few seconds, it resets your microcontroller to factory settings. I originally had button 0 selected, and I held the button down a bit too long while I was sewing it onto the hat, and .. POOF. All my settings and presets were wiped out.&nbsp;

Check out the "Backup" section under the Additonal Settings page to learn to back up your configuration and presets, in case this kind of thing happens to you.

Open up the LED settings screen in WLED under "Config". Scroll to the button setup section and set button 1 to use pin 27, with the type set as "Pushbutton" if you're using a momentary switch. Note that there are a lot of different control methods available here as well: many of these can be connected in the same way.

Click save. Try pressing your button and see if your effects change. The default behavior for button 1 is to cycle through effects, but we can change this and set up the button for any number of behaviors using the Presets panel.

![adafruit_products_button_setup.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/605/medium640/adafruit_products_button_setup.jpg?1737576779)

Next, head to the **Time & Macros** config screen. Scroll down to the Button actions area.&nbsp;

For button 1, enter the number assigned to the two control presets you made on the last page. My Next\_FX preset is number 22, so I entered 22 under "short press", and my Toggle preset is number 21, so I've got that set up as a "long press".&nbsp;

I also added my playlist toggle to preset 20, so a double-click of my button will turn sound reactive mode on or off.

![led_strips_macros.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/542/medium640/led_strips_macros.jpg?1722023424)

![led_strips_Cursor_and_Time_Settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/694/medium640/led_strips_Cursor_and_Time_Settings.jpg?1722904500)

## Troubleshooting

If your button isn't working, here are some things to try:

1. Double check both the LED preferences page and the Time & Macros page to be sure your settings are correct, and have saved.
2. Be sure your presets are correctly numbered. WLED gets confused if the presets have non-sequential IDs (so make sure they're numbered 1, 2, 3 rather than 2, 5, 7).
3. Be sure you're connected to the correct legs on your button. You want the legs on the same side (facing the same way), rather than connecting to the two top legs or the two bottom legs. Those pins are connected together inside the button so won't work when the switch is activated.

# Adafruit Sparkle Motion Mini

## WLED Additional Settings

### Brightness Limiter

Find this on the LED Settings screen.

WLED automatically limits the brightness of your project so your power supply doesn't get over-taxed. The default amperage is 850mA, which is a little low for most power supplies.

For some projects, especially battery-powered projects, having the limiter turned on is a good idea. But if you're not getting the brightness you expect, try adjusting this number to match the amperage of your power supply or battery pack.

![adafruit_products_brightness_limiter.jpg](https://cdn-learn.adafruit.com/assets/assets/000/127/565/medium640/adafruit_products_brightness_limiter.jpg?1707333888)

### Access Point (AP) Mode

While you're home, it's easy to control your project over your local WiFi network. But when you're out at a festival you probably don't have WiFi access. It's still possible to connect to your project and control it using WLED's Access Point Mode.

Turn your project on and give it a minute or two to start broadcasting. Look in your WiFi networks and find **WLED-AP** - this is a mini WiFi network being broadcast by the microcontroller. Connect to it - the default password is "wled123". An instance of WLED will automatically pop up and you can control your project from anywhere.

If you're putting your lights up in public, it's a good idea to change the AP Mode default password so strangers can't log in and control your lights. This could be a security risk.

AP Mode only broadcasts for a few minutes after you boot up the board so if you don't see the WLED-AP network try rebooting.

![led_pixels_apmode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/081/medium640/led_pixels_apmode.jpg?1711986345)

### WLED App
There are a couple different apps available to manage your WLED projects. Name and organize your projects, and find them quickly without having to type in a URL. Check the Apple or Android store for downloads.&nbsp;

My favorite is "WLED Native". It allows you to organize multiple instances and easily switch between devices without having to remember any URLs.&nbsp;

![led_pixels_wled_app.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/681/medium640/led_pixels_wled_app.jpg?1722625769)

### Backup Config & Presets
Under Config / Security & Updates you will find a place to back up your data. It's a good idea to back up your config file as soon as you're happy with the settings. Save it as a .json file on your computer. Now you can prototype and experiment to your heart's content, and if everything breaks, just re-upload this file. Or, if you're doing another build you can use this feature to copy all your settings from one board to another.

![led_pixels_backup.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/695/medium640/led_pixels_backup.jpg?1722904724)

# Adafruit Sparkle Motion Mini

## Install CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. ESP32 CircuitPython firmware is uploaded to the board via the USB serial port.

Follow this step-by-step to get CircuitPython running on your board.

## Driver Install

If this is your first time using an ESP32 board on Windows or MacOS, you may need to install the USB to serial drivers. There are two options for the USB to serial chipset on your board. If you are unsure which one you have, install both drivers.

For instructions and more information regarding the CH9102F chip and driver install, please visit the [How To Install Drivers for WCH USB to Serial Chips guide](https://learn.adafruit.com/how-to-install-drivers-for-wch-usb-to-serial-chips).

For driver downloads for the CP2104 and CP2012N, please visit the [Silicon Labs Downloads page](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads).

For those running Linux, the drivers are already included.

## CircuitPython Download
[Download the latest version of CircuitPython for this board via circuitpython.org](https://circuitpython.org/board/adafruit_mini_sparkle_motion/)
 **Click the link above to download the latest CircuitPython .bin file.**

Save it wherever is convenient for you.

![install_circuitpython_on_esp32_ESP32_CircuitPython_bin_downloaded.png](https://cdn-learn.adafruit.com/assets/assets/000/114/559/medium640/install_circuitpython_on_esp32_ESP32_CircuitPython_bin_downloaded.png?1661800263)

## Connecting to the Web Flasher

To begin, **plug your board into your computer via USB, using**  **a known-good data-sync cable** , directly, or via an adapter if needed.

**You will have to use the Chrome or a Chromium-based browser to install CircuitPython.** [For example, Edge and Opera are Chromium based](https://en.wikipedia.org/wiki/Chromium_(web_browser)).

Safari and Firefox, etc are _not_ supported - [they have not implemented Web Serial](https://developer.mozilla.org/en-US/docs/Web/API/Serial#browser_compatibility)!

In the **Chrome browser** visit [https://adafruit.github.io/Adafruit\_WebSerial\_ESPTool/](https://adafruit.github.io/Adafruit_WebSerial_ESPTool/)

The main page of the ESP Web Flasher should look something like this.

Note: The site now displays an alert that it is no longer maintained, and suggests using a different option. The ESP Web Flasher has still proven to be more consistent and easier to use, so it is highly suggested that you continue with this version.

![install_circuitpython_on_esp32_with_boot_button_ESPCP_web_flasher_main_page.png](https://cdn-learn.adafruit.com/assets/assets/000/114/594/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_web_flasher_main_page.png?1661892930)

 **You should remove all other USB devices so**  **_only_ the target board is attached.** This eliminates confusion over multiple ports!

Press the&nbsp; **Connect** button in the top right of the web browser. You will get a pop up asking you to select the COM or Serial port. Look for **USB Single Serial**.

On some systems, such as MacOS, there may be additional system ports that appear in the list (as shown in the image).

![install_circuitpython_on_esp32_with_boot_button_ESPCP_connect_and_ports.png](https://cdn-learn.adafruit.com/assets/assets/000/114/595/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_connect_and_ports.png?1661893121)

The Javascript code will now try to connect to the board. It may timeout for a bit until it succeeds. On success, you will see that it is **Connected** &nbsp;and will print out a unique&nbsp; **MAC address** identifying the board along with other information that was detected.

![install_circuitpython_on_esp32_with_boot_button_ESPCP_flasher_connection_success.png](https://cdn-learn.adafruit.com/assets/assets/000/114/596/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_flasher_connection_success.png?1661893862)

Once you have successfully connected, the command toolbar will appear.

![install_circuitpython_on_esp32_with_boot_button_ESPCP_command_tool_bar.png](https://cdn-learn.adafruit.com/assets/assets/000/114/597/medium640/install_circuitpython_on_esp32_with_boot_button_ESPCP_command_tool_bar.png?1661893964)

## Erasing the Board Contents

If you would like to erase the entire flash area so that you can start with a clean slate, you can use the erase feature. We recommend doing this every time before installing or updating CircuitPython.

To erase the contents, click the **Erase** button. You will be prompted as to whether you want to continue. Click **OK** to continue. If you do not wish to continue, click Cancel.

![install_circuitpython_on_esp32_ESPCP_click_erase_ok.png](https://cdn-learn.adafruit.com/assets/assets/000/114/630/medium640/install_circuitpython_on_esp32_ESPCP_click_erase_ok.png?1661976027)

You'll see "Erasing flash memory. Please wait..." This will eventually be followed by "Finished." and the amount of time it took to erase.

**Do not disconnect!** Immediately continue on to Programming the Board.

![install_circuitpython_on_esp32_ESPCP_erase_finished.png](https://cdn-learn.adafruit.com/assets/assets/000/114/632/medium640/install_circuitpython_on_esp32_ESPCP_erase_finished.png?1661976226)

Warning: 

## Programming the Board
You can click on **Choose a file...** from any of the available buttons. It will only attempt to program buttons with a file and a unique location. Select the&nbsp; **.bin** file you downloaded at the beginning of this page from the file chooser dialogue.

Verify that the **Offset** box next to the file location you used is 0x0. The offset defaults to 0x0, so unless you changed it manually, it should be good to go.

![install_circuitpython_on_esp32_ESPCP_choose_a_file.png](https://cdn-learn.adafruit.com/assets/assets/000/114/633/medium640/install_circuitpython_on_esp32_ESPCP_choose_a_file.png?1661976639)

![install_circuitpython_on_esp32_ESPCP_bin_to_upload.png](https://cdn-learn.adafruit.com/assets/assets/000/114/669/medium640/install_circuitpython_on_esp32_ESPCP_bin_to_upload.png?1661979129)

Once you choose a file, the button text will change to match your filename. You can then click the **Program** button to start flashing.

![install_circuitpython_on_esp32_ESPCP_bin_loaded_press_program.png](https://cdn-learn.adafruit.com/assets/assets/000/114/655/medium640/install_circuitpython_on_esp32_ESPCP_bin_loaded_press_program.png?1661978037)

A progress bar will appear and after a minute or two, you will have written the firmware.

![install_circuitpython_on_esp32_ESPCP_programming_the_bin.png](https://cdn-learn.adafruit.com/assets/assets/000/114/656/medium640/install_circuitpython_on_esp32_ESPCP_programming_the_bin.png?1661978267)

You've now successfully programmed CircuitPython onto your board! As suggested in the output, press reset to run the new firmware.

![install_circuitpython_on_esp32_ESPCP_programming_complete.png](https://cdn-learn.adafruit.com/assets/assets/000/114/668/medium640/install_circuitpython_on_esp32_ESPCP_programming_complete.png?1661978790)

As the ESP32 does not have native USB, no USB drive will show up on your computer when you reset. With CircuitPython firmware loaded, the REPL can be accessed over a serial/COM port.

For more details on installation, how to configure your ESP32, and info on getting started with CircuitPython on your ESP32 using the Web Workflow, check out the [CircuitPython on ESP32 Quick Start guide](https://learn.adafruit.com/circuitpython-with-esp32-quick-start).

# Adafruit Sparkle Motion Mini

## Connecting to the USB Workflow Code Editor

Warning: The USB workflow is a new feature and there may be bugs! If you find a bug, please [file an issue on GitHub](https://github.com/circuitpython/web-editor/issues).

To use the Code Editor, you will need an internet browser such as Google Chrome or Microsoft Edge. It's possible that it may work in other browsers as well, but these have been more thoroughly tested.

Open your browser and navigate to [https://code.circuitpython.org/](https://code.circuitpython.org/). Select **USB** on the dialog prompt that comes up.

![circuitpython_Screenshot_2024-07-01_at_10.27.14_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/966/medium640/circuitpython_Screenshot_2024-07-01_at_10.27.14_AM.png?1719854918)

This will display a page of instructions along with a **button** to bring up a list of devices to connect to.

Click **Connect to Device** and then **select your board** in the pop-up window. Click **Connect** to connect your board to the editor.

![circuitpython_Screenshot_2024-07-01_at_10.29.39_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/967/medium640/circuitpython_Screenshot_2024-07-01_at_10.29.39_AM.png?1719855227)

![circuitpython_Screenshot_2024-07-01_at_10.38.48_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/970/medium640/circuitpython_Screenshot_2024-07-01_at_10.38.48_AM.png?1719855548)

Once you have connected, the **Connect** button in the upper right-hand corner should change to a **Disconnect** button.

![wireless_Disconnect_Button.png](https://cdn-learn.adafruit.com/assets/assets/000/114/892/medium640/wireless_Disconnect_Button.png?1662672956)

# Adafruit Sparkle Motion Mini

## Navigating USB Workflow

## Opening and Saving Files

Opening and Saving files is designed to be like to most other applications.&nbsp;Just use the buttons along the top of the editor window.

Clicking the **Open** or&nbsp; **Save As** buttons along the top will open the File Dialog. Clicking the **Save + Run** button will save your file and run the code. If your file hasn't been saved yet, this will also bring up the file dialog box.

![wireless_Screenshot_2024-07-02_at_8.46.57_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/130/980/medium640/wireless_Screenshot_2024-07-02_at_8.46.57_AM.png?1719935356)

The file dialog that appears is a simplified dialog that displays the current path at the top, allows you to navigate through the file tree to select the file you would like to open, and has buttons on the bottom to open or save the file you would like to use.

Canceling will tell the editor that you do not want to continue with the current operation.

![wireless_File_dialog.png](https://cdn-learn.adafruit.com/assets/assets/000/115/953/medium640/wireless_File_dialog.png?1666046715)

The X at the top performs the same function as the Cancel button as does clicking outside of the dialog.

On the Save As dialog, you can also type in a filename in the field next to the button.

![wireless_File_dialog_2.png](https://cdn-learn.adafruit.com/assets/assets/000/115/954/medium640/wireless_File_dialog_2.png?1666046738)

## Running Code

As mentioned above, the&nbsp; **Save + Run** button will first save your file, then run the code. The logic to run the code however is currently very simplistic in that it will try a couple of basic strategies to run your code, but doesn't currently do much beyond that.

The way it works is if you are working on **code.py** in the root folder, a soft reset will be performed, which automatically runs **code.py**. If you were working on some code in another file, the editor will attempt to perform an import on this code, which should run it. When you run your code, it will automatically switch over to the serial terminal.

Click the **Save + Run** &nbsp;button to save and run the code current code.

![wireless_Save_and_Run.png](https://cdn-learn.adafruit.com/assets/assets/000/114/853/medium640/wireless_Save_and_Run.png?1662509114)

## File Dialog Toolbar

The file Dialog toolbar along the top allows you to perform common operations on files and folders regardless of whether you are saving or opening. Clicking the cancel button at the bottom will not undo any operations that were performed with these buttons.

### Renaming and Deleting Files and Folders

You can rename or delete both files and folders. An item must be selected first for the buttons to become available.

Use the **delete** and **rename** buttons here to perform the corresponding operation on the currently selected file or folder.

![wireless_Delete_and_Rename.png](https://cdn-learn.adafruit.com/assets/assets/000/115/955/medium640/wireless_Delete_and_Rename.png?1666047250)

### Creating New Folders

This feature allows you to create a new folder to store your work inside of.

Clicking the **new folder** button at the top will prompt you for a folder name. It will inform you of invalid folder names such as the same name as an existing file or folder or a folder that begins with a period.

![wireless_New_Folder.png](https://cdn-learn.adafruit.com/assets/assets/000/115/956/medium640/wireless_New_Folder.png?1666047276)

![wireless_New_Folder_Prompt.png](https://cdn-learn.adafruit.com/assets/assets/000/115/957/medium640/wireless_New_Folder_Prompt.png?1666047296)

### Uploading and Downloading Files and Folders

This feature allows you to upload or download files as long as they fit in the available space. If you need to add images or sound files for your project, you can use the upload button to add them. If you need to retrieve a file from your device for whatever reason, the download button will give you access to do that.

You can also download folders. When you select a folder and click download, the contents of that folder are automatically zipped into a single file. If nothing is selected when you click the download button, the current folder will be used.

Use the **upload** or **download** buttons to easily add files or retrieve them from your board.

![wireless_Upload_and_Download.png](https://cdn-learn.adafruit.com/assets/assets/000/115/958/medium640/wireless_Upload_and_Download.png?1666047325)

### Moving Files and Folders

This feature allows you to move files and folders to a different location on the device. When you click the move button, another prompt will appear on top of the dialog that allows you to navigate to where you would like to move the currently selected item.&nbsp;

Use the **move** button to move files or folders to a new location on the device.

The second dialog that appears will show only folders and allow you to navigate to where you would like to move the file.

![wireless_Move_Item.png](https://cdn-learn.adafruit.com/assets/assets/000/115/959/medium640/wireless_Move_Item.png?1666047519)

![wireless_Move_Item_Prompt.png](https://cdn-learn.adafruit.com/assets/assets/000/115/960/medium640/wireless_Move_Item_Prompt.png?1666047536)

## Using the Serial Terminal
The serial terminal allows you to watch the output of your device as well as type inputs just like you can from a separate application like PuTTY, except there's nothing you need to configure. This allows you to access the REPL or view the output of your currently running code.

Use the mode buttons in the bottom left-hand corner to open and close the serial and editor panes.

![wireless_Screenshot_2024-07-03_at_8.08.00_AM.png](https://cdn-learn.adafruit.com/assets/assets/000/131/075/medium640/wireless_Screenshot_2024-07-03_at_8.08.00_AM.png?1720019348)

## More Features to Come

The CircuitPython Code Editor is still under development, so expect more features to be added. If you would like to contribute [on GitHub](https://github.com/circuitpython/web-editor/), you can submit any new issues or pull requests for review.

# Adafruit Sparkle Motion Mini

## Blink

In learning any programming language, you often begin with some sort of `Hello, World!` program. In CircuitPython, Hello, World! is blinking an LED. Blink is one of the simplest programs in CircuitPython. It involves three built-in modules, two lines of set up, and a short loop. Despite its simplicity, it shows you many of the basic concepts needed for most CircuitPython programs, and provides a solid basis for more complex projects. Time to get blinky!

## LED Location
![](https://cdn-learn.adafruit.com/assets/assets/000/134/562/medium800/adafruit_products_cp_examples_led.png?1737490234)

## Blinking an LED

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 **CircuitPython\_Templates/blink/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/blink/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![blink_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/893/medium640/blink_upload.jpg?1724077429)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![blink_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/894/medium640/blink_code_dot_py.jpg?1724077767)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![blink_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/895/medium640/blink_overwrite.jpg?1724077804)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![blink_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/896/medium640/blink_openCode.jpg?1724077840)

You'll see the LED blink **code.py** file contents. Click **Restart** above the Serial monitor to run the LED blink code.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/897/medium800/blink_restartCode.jpg?1724077902)

The built-in LED begins blinking!

Note that the code is a little less "Pythonic" than it could be. It could also be written as `led.value = not led.value` with a single `time.sleep(0.5)`. That way is more difficult to understand if you're new to programming, so the example is a bit longer than it needed to be to make it easier to read.

It's important to understand what is going on in this program.

First you `import` three modules: `time`, `board` and `digitalio`. This makes these modules available for use in your code. All three are built-in to CircuitPython, so you don't need to download anything to get started.

Next, you set up the LED. To interact with hardware in CircuitPython, your code must let the board know where to look for the hardware and what to do with it. So, you create a `digitalio.DigitalInOut()` object, provide it the LED pin using the `board` module, and save it to the variable `led`. Then, you tell the pin to act as an `OUTPUT`.

Finally, you create a `while True:` loop. This means all the code inside the loop will repeat indefinitely. Inside the loop, you set `led.value = True` which powers on the LED. Then, you use `time.sleep(0.5)` to tell the code to wait half a second before moving on to the next line. The next line sets `led.value = False` which turns the LED off. Then you use another `time.sleep(0.5)` to wait half a second before starting the loop over again.

With only a small update, you can control the blink speed. The blink speed is controlled by the amount of time you tell the code to wait before moving on using `time.sleep()`. The example uses `0.5`, which is one half of one second. Try increasing or decreasing these values to see how the blinking changes.

That's all there is to blinking an LED using CircuitPython!

# Adafruit Sparkle Motion Mini

## Digital Input

The CircuitPython `digitalio` module has many applications. The basic Blink program sets up the LED as a digital output. You can just as easily set up a **digital input** such as a button to control the LED. This example builds on the basic Blink example, but now includes setup for a button switch. Instead of using the `time` module to blink the LED, it uses the status of the button switch to control whether the LED is turned on or off.

## LED and Button
![](https://cdn-learn.adafruit.com/assets/assets/000/134/564/medium800/adafruit_products_cp_examples_digitalio.png?1737490740)

## Controlling the LED with a Button

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 **CircuitPython\_Templates/digital\_input\_built\_in\_button\_led/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/digital_input_built_in_button_led/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![digital_input___little_led_and_button_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/899/medium640/digital_input___little_led_and_button_upload.jpg?1724078447)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![digital_input___little_led_and_button_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/900/medium640/digital_input___little_led_and_button_code_dot_py.jpg?1724078473)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![digital_input___little_led_and_button_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/901/medium640/digital_input___little_led_and_button_overwrite.jpg?1724078490)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![digital_input___little_led_and_button_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/902/medium640/digital_input___little_led_and_button_openCode.jpg?1724078507)

You'll see the digital input **code.py** file contents. Click **Restart** above the Serial monitor to run the digital input code.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/903/medium800/digital_input___little_led_and_button_digiRestart.jpg?1724078690)

Now, press the button. The LED lights up! Let go of the button and the LED turns off.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/631/medium800thumb/adafruit_products_sparklemotion_digitalio_gif20.jpg?1737656289)

Note that the code is a little less "Pythonic" than it could be. It could also be written as `led.value = not button.value`. That way is more difficult to understand if you're new to programming, so the example is a bit longer than it needed to be to make it easier to read.

First you `import` two modules: `board` and `digitalio`. This makes these modules available for use in your code. Both are built-in to CircuitPython, so you don't need to download anything to get started.

Next, you set up the LED. To interact with hardware in CircuitPython, your code must let the board know where to look for the hardware and what to do with it. So, you create a `digitalio.DigitalInOut()` object, provide it the LED pin using the `board` module, and save it to the variable `led`. Then, you tell the pin to act as an `OUTPUT`.

You include setup for the button as well. It is similar to the LED setup, except the button is an `INPUT`, and requires a pull up.

Inside the loop, you check to see if the button is pressed, and if so, turn on the LED. Otherwise the LED is off.

That's all there is to controlling an LED with a button switch!

# Adafruit Sparkle Motion Mini

## Analog Input

The CircuitPython `analogio` module has many applications. You can set up an&nbsp; **analog**** &nbsp;input** with a potentiometer connected to an analog input pin on your board.

## Necessary Hardware

You'll need the following additional hardware to complete the examples on this page.

### Potentiometer with Built In Knob - 10K ohm

[Potentiometer with Built In Knob - 10K ohm](https://www.adafruit.com/product/4133)
_Oh say can you see_  
_By the knob's early light..._

Sorry - we thought that was clever. &nbsp;And while it wasn't really, this potentiometer definitely is! We've seen these in miniature synthesizers. They're bigger than a trim-pot but smaller than a...

In Stock
[Buy Now](https://www.adafruit.com/product/4133)
[Related Guides to the Product](https://learn.adafruit.com/products/4133/guides)
![Potentiometer with Built In Knob](https://cdn-shop.adafruit.com/640x480/4133-03.jpg)

### JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable

[JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable](https://www.adafruit.com/product/5755)
If you fancy connecting to&nbsp;anything else with a JST SH compatible 3-pin connector, this cable will do the trick. For example, our [NeoPixel JST Breakout boards](https://www.adafruit.com/product/5975), or [UPDI Friend](https://www.adafruit.com/product/5879), or <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/5755)
[Related Guides to the Product](https://learn.adafruit.com/products/5755/guides)
![angled shot of 100mm long JST-SH 3-pin cable with male headers.](https://cdn-shop.adafruit.com/640x480/5755-02.jpg)

## Wiring
- **JST-SH signal** to **potentiometer wiper (white wire)**
- **JST-SH 3.3V** to **potentiometer positive (red wire)**
- **JST-SH GND** to **potentiometer ground (black wire)**

![adafruit_products_mini_sparkle_pot_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/645/medium640/adafruit_products_mini_sparkle_pot_bb.jpg?1737676688)

## Reading the Potentiometer

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 **CircuitPython\_Templates/analog\_voltage\_values/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/analog_voltage_values/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![digital_input___little_led_and_button_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/899/medium640/digital_input___little_led_and_button_upload.jpg?1724078447)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![digital_input___little_led_and_button_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/900/medium640/digital_input___little_led_and_button_code_dot_py.jpg?1724078473)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![digital_input___little_led_and_button_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/901/medium640/digital_input___little_led_and_button_overwrite.jpg?1724078490)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![digital_input___little_led_and_button_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/902/medium640/digital_input___little_led_and_button_openCode.jpg?1724078507)

You'll see the analog input **code.py** file contents. Click **Restart** above the Serial monitor to run the analog input code.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/642/medium800/analog_input_Screenshot_2025-01-23_185101.png?1737676292)

Now, twist and turn the potentiometer. You'll see the analog voltage values print&nbsp; to the serial console.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/643/medium800/adafruit_products_Screenshot_2025-01-23_185242.png?1737676374)

# Adafruit Sparkle Motion Mini

## Built-In NeoPixel

Your board has a built-in RGB NeoPixel status LED. You can use CircuitPython code to control the color and brightness of this LED. It is also used to indicate the bootloader status and errors in your CircuitPython code.

A NeoPixel is what Adafruit calls the WS281x family of addressable RGB LEDs. It contains three LEDs - a red one, a green one and a blue one - along side a driver chip in a tiny package controlled by a single pin. They can be used individually (as in the built-in LED on your board), or chained together in strips or other creative form factors. NeoPixels do not light up on their own; they require a microcontroller. So, it's super convenient that the NeoPixel is built in to your microcontroller board!

This page will cover using CircuitPython to control the status RGB NeoPixel built into your microcontroller. You'll learn how to change the color and brightness, and how to make a rainbow. Time to get started!

## NeoPixel Location
![](https://cdn-learn.adafruit.com/assets/assets/000/134/566/medium800/adafruit_products_cp_examples_neopixel.png?1737491160)

## NeoPixel Color and Brightness

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

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 **CircuitPython\_Templates/status\_led\_one\_neopixel\_rgb/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/status_led_one_neopixel_rgb/code.py

## Update the **/lib** Folder
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Folders**.

![built_in_neopixel_uploadFolders.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/912/medium640/built_in_neopixel_uploadFolders.jpg?1724082553)

Navigate to the project bundle that you downloaded and select the **/lib folder**.

![built_in_neopixel_uploadLib.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/913/medium640/built_in_neopixel_uploadLib.jpg?1724082575)

You'll be asked if you want to upload the **/lib** folder from the&nbsp;Project Bundle. Click **Upload**.

![built_in_neopixel_confirmUploadNeo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/914/medium640/built_in_neopixel_confirmUploadNeo.jpg?1724082591)

After the upload finishes, you can open the **lib** folder to view the two library files required for the NeoPixel examples.

![built_in_neopixel_updatedLibNeo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/915/medium640/built_in_neopixel_updatedLibNeo.jpg?1724082622)

## Update **code.py**
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![built_in_neopixel_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/909/medium640/built_in_neopixel_upload.jpg?1724082434)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![built_in_neopixel_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/910/medium640/built_in_neopixel_code_dot_py.jpg?1724082449)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![built_in_neopixel_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/911/medium640/built_in_neopixel_overwrite.jpg?1724082469)

The built-in NeoPixel begins blinking red, then green, then blue, and repeats!

![](https://cdn-learn.adafruit.com/assets/assets/000/134/638/medium800thumb/adafruit_products_neopixel_rgb_color_op.jpg?1737662879)

First you import two modules, `time` and `board`, and one library, `neopixel`. This makes these modules and libraries available for use in your code. The first two are modules built-in to CircuitPython, so you don't need to download anything to use those. The `neopixel` library is separate, which is why you needed to install it before getting started.

Next, you set up the NeoPixel LED. To interact with hardware in CircuitPython, your code must let the board know where to look for the hardware and what to do with it. So, you create a `neopixel.NeoPixel()` object, provide it the NeoPixel LED pin using the `board` module, and tell it the number of LEDs. You save this object to the variable `pixel`.

Then, you set the NeoPixel brightness using the `brightness` attribute. `brightness` expects float between `0` and `1.0`. A _float_ is essentially a number with a decimal in it. The brightness value represents a percentage of maximum brightness; `0` is 0% and `1.0` is 100%. Therefore, setting `pixel.brightness = 0.3` sets the brightness to 30%. The default brightness, which is to say the brightness if you don't explicitly set it, is `1.0`. The default is really bright! That is why there is an option available to easily change the brightness.

Inside the loop, you turn the NeoPixel red for 0.5 seconds, green for 0.5 seconds, and blue for 0.5 seconds.

To turn the NeoPixel red, you "fill" it with an RGB value. Check out the section below for details on RGB colors. The RGB value for red is `(255, 0, 0)`. Note that the RGB value includes the parentheses. The `fill()` attribute expects the full RGB value including those parentheses. That is why there are two pairs of parentheses in the code.

You can change the RGB values to change the colors that the NeoPixel cycles through. Check out the list below for some examples. You can make any color of the rainbow with the right RGB value combination!

That's all there is to changing the color and setting the brightness of the built-in NeoPixel LED!

## RGB LED Colors

RGB LED colors are set using a combination of&nbsp; **r** ed, **g** reen, and **b** lue, in the form of an ( **R** ,&nbsp; **G** , **B** ) tuple. Each member of the tuple is set to a number between 0 and 255 that determines the amount of each color present. Red, green and blue in different combinations can create all the colors in the rainbow! So, for example, to set an LED to red, the tuple would be `(255, 0, 0)`, which has the maximum level of red, and no green or blue. Green would be `(0, 255, 0)`, etc. For the colors between, you set a combination, such as cyan which is `(0, 255, 255)`, with equal amounts of green and blue. If you increase all values to the same level, you get white! If you decrease all the values to 0, you turn the LED off.

Common colors include:

- red: `(255, 0, 0)`
- green: `(0, 255, 0)`
- blue: `(0, 0, 255)`
- cyan: `(0, 255, 255)`
- purple: `(255, 0, 255)`
- yellow: `(255, 255, 0)`
- white: `(255, 255, 255)`
- black (off): `(0, 0, 0)`

## NeoPixel Rainbow

You should have already installed the library necessary to use the built-in NeoPixel LED. If not, follow the steps at the beginning of the NeoPixel Color and Brightness section to install it.

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 **CircuitPython\_Templates/status\_led\_one\_neopixel\_rainbow/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/status_led_one_neopixel_rainbow/code.py

Update the **code.py** file in the USB code editor with the rainbow **code.py** file. The same libraries from the RGB blinking example are used. The NeoPixel displays a rainbow cycle!

![](https://cdn-learn.adafruit.com/assets/assets/000/134/633/medium800thumb/adafruit_products_neopixel_rainbow.jpg?1737661166)

This example builds on the previous example.

First, you import the same three modules and libraries. In addition to those, you import `colorwheel`.

The NeoPixel hardware setup and brightness setting are the same.

Next, you have the `rainbow()` helper function. This helper displays the rainbow cycle. It expects a `delay` in seconds. The higher the number of seconds provided for `delay`, the slower the rainbow will cycle. The helper cycles through the values of the color wheel to create a rainbow of colors.

Inside the loop, you call the rainbow helper with a 0.2 second delay, by including `rainbow(0.2)`.

That's all there is to making rainbows using the built-in NeoPixel LED!

# Adafruit Sparkle Motion Mini

## Sparkle Motion NeoPixel Demo

![](https://cdn-learn.adafruit.com/assets/assets/000/134/578/medium800thumb/adafruit_products_sparklemotion_mini_neopixel_animation.jpg?1737506604)

The main use of the Sparkle Motion Mini is lighting up RGB LEDs to dazzle and delight. CircuitPython has the [Adafruit\_CircuitPython\_Neopixel](https://github.com/adafruit/Adafruit_CircuitPython_Neopixel) module, which allows you to easily write Python code that lets you control NeoPixels, as well as the [Adafruit\_CircuitPython\_LED\_Animation](https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation) module that provides more advanced control with an assortment of fun and colorful animations. In the example below, you'll run two different LED animations on two strips of NeoPixels at the same time.&nbsp;

## Wiring
NeoPixels

- **terminal block G** to **GND** on both NeoPixel strips. (black wire, going through breadboard GND rail)
- **terminal block 5V** &nbsp;to **5V** on both NeoPixel strips. (red wire, going through breadboard power rail)
- **terminal block 33** to **DIN** on the first NeoPixel strip. (green wire)
- **terminal block 32** to **DIN** on the second NeoPixel strip. (green wire)

![adafruit_products_neopixel_animations_example_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/134/573/medium640/adafruit_products_neopixel_animations_example_bb.png?1737500010)

## CircuitPython Usage

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

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 **Sparkle\_Motion\_Mini\_Examples/CircuitPython\_Sparkle\_Motion\_Mini\_Neopixel\_Animation/** and then click on the directory that matches the version of CircuitPython you're using.

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Sparkle_Motion_Mini_Examples/CircuitPython_Sparkle_Motion_Mini_Neopixel_Animation/code.py

## Update the **/lib** Folder
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Folders**.

![adafruit_products_built_in_neopixel_uploadFolders.png](https://cdn-learn.adafruit.com/assets/assets/000/134/579/medium640/adafruit_products_built_in_neopixel_uploadFolders.png?1737555744)

Navigate to the project bundle that you downloaded and select the **/lib folder**.

![adafruit_products_built_in_neopixel_uploadLib.png](https://cdn-learn.adafruit.com/assets/assets/000/134/580/medium640/adafruit_products_built_in_neopixel_uploadLib.png?1737555786)

You'll be asked if you want to upload the **/lib** folder from the&nbsp;Project Bundle. Click **Upload**.

![adafruit_products_built_in_neopixel_confirmUploadNeo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/582/medium640/adafruit_products_built_in_neopixel_confirmUploadNeo.jpg?1737555901)

After the upload finishes, you can open the **lib** folder to view the two library files required for the NeoPixel examples.

Your&nbsp; **CIRCUITPY/lib** &nbsp;folder should contain the following folders:

- **adafruit\_led\_animation/**
- **adafruit\_pixelbuf.mpy**
- **neopixel.mpy**

![adafruit_products_neopixel_animation_libs.png](https://cdn-learn.adafruit.com/assets/assets/000/134/583/medium640/adafruit_products_neopixel_animation_libs.png?1737556492)

## Update **code.py**
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![adafruit_products_built_in_neopixel_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/584/medium640/adafruit_products_built_in_neopixel_upload.jpg?1737556778)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![adafruit_products_blink_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/585/medium640/adafruit_products_blink_code_dot_py.jpg?1737556969)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![adafruit_products_blink_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/586/medium640/adafruit_products_blink_overwrite.jpg?1737557001)

This example utilizes both of the NeoPixel outputs on terminal blocks `D33` and `D32`. It starts by initializing variables for the pixel pins and count of how many NeoPixels are in each strip. Next it creates instances of `neopixel.NeoPixel` for each strip. Then it creates a `Comet` animation on one strip, and a `Rainbow` animation on the other. Inside of the main `while True:` each animation object has it's `animate()` function called to advance it by one step.

# Adafruit Sparkle Motion Mini

## I2C Scan

![](https://cdn-learn.adafruit.com/assets/assets/000/114/225/medium800/i2c_I2C_controller_target.jpg?1660678571 A QT Py ESP32-S2 connected to an MCP9808 Temperature Sensor for I2C via STEMMA QT.)

The **I2C** , or [inter-integrated circuit](https://en.wikipedia.org/wiki/I%C2%B2C), is a 2-wire protocol for communicating with simple sensors and devices, which means it uses two connections, or wires, for transmitting and receiving data. One connection is a clock, called **SCL**. The other is the data line, called **SDA**. Each pair of clock and data pins are referred to as a **bus**.

Typically, there is a device that acts as a **controller** and sends requests to the **target** devices on each bus. In this case, your microcontroller board acts as the controller, and the sensor breakout acts as the target. Historically, the controller is referred to as the master, and the target is referred to as the slave, so you may run into that terminology elsewhere. The official terminology is [controller and target](https://adafruit.com/controller-peripheral).

**Multiple I2C devices can be connected to the same clock and data lines.** Each I2C device has an address, and as long as the addresses are different, you can connect them at the same time. This means you can have many different sensors and devices all connected to the same two pins.

**Both I2C connections require pull-up resistors** , and most Adafruit I2C sensors and breakouts have pull-up resistors built in. If you're using one that does not, you'll need to add your own 2.2-10kΩ pull-up resistors from SCL and SDA to 3.3V.

## I2C and CircuitPython

CircuitPython supports many I2C devices, and makes it super simple to interact with them. There are libraries available for many I2C devices in the [CircuitPython Library Bundle](https://circuitpython.readthedocs.io/projects/bundle/en/latest/#table-of-contents). (If you don't see the sensor you're looking for, keep checking back, more are being written all the time!)

In this section, you'll learn how to scan the I2C bus for all connected devices. Then you'll learn how to interact with an I2C device.

## Necessary Hardware

You'll need the following additional hardware to complete the examples on this page.

### Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout

[Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout](https://www.adafruit.com/product/5027)
The MCP9808 digital temperature sensor is one of the more accurate/precise we've ever seen, with a typical accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°C. They work great with any microcontroller using standard I2C. With...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5027)
[Related Guides to the Product](https://learn.adafruit.com/products/5027/guides)
![Top view of temperature sensor breakout above an OLED display FeatherWing. The OLED display reads "MCP9808 Temp: 24.19ºC"](https://cdn-shop.adafruit.com/640x480/5027-04.jpg)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

While the examples here will be using the [Adafruit MCP9808](https://www.adafruit.com/product/5027), a high accuracy temperature sensor, the overall process is the same for just about any I2C sensor or device.

The first thing you'll want to do is get the sensor connected so your board has I2C to talk to.

## Wiring the MCP9808

The MCP9808 comes with a STEMMA QT connector, which makes wiring it up quite simple and solder-free.

Connect the STEMMA QT cable from&nbsp; **the STEMMA QT port on your board** &nbsp;to&nbsp; **the STEMMA QT port on the MCP9808**.

![adafruit_products_mini_sparkle_i2c.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/623/medium640/adafruit_products_mini_sparkle_i2c.jpg?1737645861)

## Find Your Sensor

The first thing you'll want to do after getting the sensor wired up, is make sure it's wired correctly. You're going to do an I2C scan to see if the board is detected, and if it is, print out its I2C address.

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 **CircuitPython\_Templates/i2c\_scan/** and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/i2c_scan/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![i2c_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/905/medium640/i2c_upload.jpg?1724080096)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![i2c_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/906/medium640/i2c_code_dot_py.jpg?1724080113)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![i2c_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/907/medium640/i2c_overwrite.jpg?1724080129)

You'll see a new **code.py** file appear in the file browser. **Select it** and click **Open** to view it in the code editor.

![i2c_openCode.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/908/medium640/i2c_openCode.jpg?1724080143)

![](https://cdn-learn.adafruit.com/assets/assets/000/134/635/medium800/adafruit_products_repl_i2c_scan.png?1737662001)

If you run this and it seems to hang, try manually unlocking your I2C bus by running the following two commands from the REPL.

```terminal
import board
board.I2C().unlock()
```

First you create the `i2c` object, using `board.I2C()`. This convenience routine creates and saves a `busio.I2C` object using the default pins `board.SCL` and `board.SDA`. If the object has already been created, then the existing object is returned. No matter how many times you call `board.I2C()`, it will return the same object. This is called a _singleton_.

To be able to scan it, you need to lock the I2C down so the only thing accessing it is the code. So next you include a loop that waits until I2C is locked and then continues on to the scan function.

Last, you have the loop that runs the actual scan, `i2c_scan()`. Because I2C typically refers to addresses in hex form, the example includes this bit of code that formats the results into hex format: `[hex(device_address) for device_address in i2c.scan()]`.

Open the serial console to see the results! The code prints out an array of addresses. You've connected the MCP9808 which has a 7-bit I2C address of 0x18. The result for this sensor is `I2C addresses found: ['0x18']`. If no addresses are returned, refer back to the wiring diagrams to make sure you've wired up your sensor correctly.

# Adafruit Sparkle Motion Mini

## WiFi Test

In this example, you'll test your Sparkle Motion Mini WiFi connection by connecting to your SSID, printing your MAC address and IP address to the REPL and then pinging Google.

## **settings.toml** File

If you've worked on WiFi projects with CircuitPython before, you're probably familiar with the **secrets.py** file. This file is a Python file that is stored on your **CIRCUITPY** drive that contains all of your secret WiFi information, such as your SSID, SSID password and any API keys for IoT services.&nbsp;

As of [CircuitPython 8](https://circuitpython.org/downloads), there is support for a **settings.toml** file. Similar to **secrets.py** , the **settings.toml** file separates your sensitive information from your main **code.py** file.

Warning: Your settings.toml file should be stored in the main directory of your board. It should not be in a folder.

## **settings.toml&nbsp;** File Example

Here is an example on how to format your&nbsp; **settings.toml** &nbsp;file.

```auto
# Comments are supported
CIRCUITPY_WIFI_SSID="guest wifi"
CIRCUITPY_WIFI_PASSWORD="guessable"
CIRCUITPY_WEB_API_PORT=80
CIRCUITPY_WEB_API_PASSWORD="passw0rd"
test_variable="this is a test"
thumbs_up="\U0001f44d"
```

In a&nbsp; **settings.toml** &nbsp;file, it's important to keep these factors in mind:

- Strings are wrapped in double quotes; ex:&nbsp;`"your-string-here"`
- Integers are&nbsp;_ **not** _&nbsp;quoted and may be written in decimal with optional sign (`+1`,&nbsp;`-1`,&nbsp;`1000`) or hexadecimal (`0xabcd`).
  - Floats, octal (`0o567`) and binary (`0b11011`) are not supported.

- Use&nbsp;`\u`&nbsp;escapes for weird characters,&nbsp;`\x`&nbsp;and&nbsp;`\ooo`&nbsp;escapes are not available in&nbsp; **.toml** &nbsp;files
  - Example:&nbsp;`\U0001f44d`&nbsp;for 👍 (thumbs up emoji) and&nbsp;`\u20ac`&nbsp;for € (EUR sign)

- Unicode emoji, and non-ASCII characters, stand for themselves as long as you're careful to save in "UTF-8 without BOM" format

When your&nbsp; **settings.toml&nbsp;** file is ready, you can save it in your text editor with the&nbsp; **.toml** &nbsp;extension.

![circuitpython_internet_test___settings_toml_adafruit_products_dotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/122/208/medium640/circuitpython_internet_test___settings_toml_adafruit_products_dotToml.jpg?1688042031)

## CircuitPython WiFi Example
In the example below, click the **Download Project Bundle** button below to download the&nbsp; **code.py** file in a zip file. Extract the contents of the zip file and then click on the directory that matches the version of CircuitPython you're using.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Pico_W_CircuitPython_WiFi_Examples/Pico_W_Basic_WiFi_Test/code.py

In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![circuitpython_internet_test___settings_toml_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/916/medium640/circuitpython_internet_test___settings_toml_upload.jpg?1724083097)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![circuitpython_internet_test___settings_toml_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/917/medium640/circuitpython_internet_test___settings_toml_code_dot_py.jpg?1724083117)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![circuitpython_internet_test___settings_toml_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/918/medium640/circuitpython_internet_test___settings_toml_overwrite.jpg?1724083133)

## Update Your **settings.toml** File

Remember to add your **settings.toml** file as described earlier in this page. You'll need to include your `CIRCUITPY_WIFI_SSID` and `CIRCUITPY_WIFI_PASSWORD` in the file.&nbsp;

You can edit the file manually in the USB code editor by clicking **Open** , selecting **settings.toml** and clicking **Open** at the bottom of the dialog box.

![circuitpython_internet_test___settings_toml_openSettingsDotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/919/medium640/circuitpython_internet_test___settings_toml_openSettingsDotToml.jpg?1724083258)

With **settings.toml** open in the editor, you can add your WiFi credentials:

`CIRCUITPY_WIFI_SSID = "your-ssid-here"`  
`CIRCUITPY_WIFI_PASSWORD = "your-ssid-password-here"`

Once your credentials are entered, click **Save** above the editor to save your changes to **settings.toml**.

![circuitpython_internet_test___settings_toml_editSettingsDotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/920/medium640/circuitpython_internet_test___settings_toml_editSettingsDotToml.jpg?1724083365)

Once everything is saved to the&nbsp;board, **Restart** the Serial Console to see the data printed out!

![](https://cdn-learn.adafruit.com/assets/assets/000/134/636/medium800/adafruit_products_repl_wifi.png?1737662163)

## How the CircuitPython WiFi Example Works

In the basic WiFi test, the board connects to your SSID by importing your SSID and SSID password from the **settings.toml**** &nbsp;**file.

```python
wifi.radio.connect(os.getenv('CIRCUITPY_WIFI_SSID'), os.getenv('CIRCUITPY_WIFI_PASSWORD'))
```

Then, your MAC address and IP address are printed to the REPL.

```python
#  prints MAC address to REPL
print("My MAC addr:", [hex(i) for i in wifi.radio.mac_address])

#  prints IP address to REPL
print("My IP address is", wifi.radio.ipv4_address)
```

Finally, google.com is pinged. The amount of time it takes to ping is printed to the REPL and the code stops running.

```python
#  pings Google
ipv4 = ipaddress.ip_address("8.8.4.4")
print("Ping google.com: %f ms" % (wifi.radio.ping(ipv4)*1000))
```

By successfully running this WiFi test code, you can confirm that your board is connecting to WiFi with CircuitPython successfully and you can move on to more advanced projects.

# Adafruit Sparkle Motion Mini

## Adafruit IO

Adafruit IO gives you the option to disconnect your microcontroller from your computer and run it off of USB power or a battery, and still be able to see the data. It also allows you to send data to your microcontroller, such as NeoPixel colors. This example shows how to both send data to and receive data from Adafruit IO. It pulls from a "random" number generator and sends the "random" number _to_ Adafruit IO, while simultaneously listening for NeoPixel color data _from_ Adafruit IO.

## NeoPixel Location
![](https://cdn-learn.adafruit.com/assets/assets/000/134/567/medium800/adafruit_products_cp_examples_neopixel.png?1737491660)

## Adafruit IO Feeds and Dashboard

The first thing you'll need to do, is head over to [Adafruit IO](https://io.adafruit.com/) and make sure your account is set up.

Then, you need to [create two feeds](https://learn.adafruit.com/adafruit-io-basics-feeds/creating-a-feed) called **neopixel** and **random**. These are case sensitive!

Next, you'll [create a dashboard](https://learn.adafruit.com/adafruit-io-basics-dashboards/creating-a-dashboard) for the NeoPixel Color Picker. You can name the dashboard whatever you like.

Once the dashboard is created, you'll want to [add a color picker block](https://learn.adafruit.com/adafruit-io-basics-dashboards/adding-blocks). The color picker block is highlighted by a red arrow in the image below.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/400/medium800/adafruit_io_send_and_recieve_data_AIO_choose_color_picker_block.png?1646162219)

Once you choose the color picker block, you'll need to connect a feed to it. Check the box next to **neopixel**.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/402/medium800/adafruit_io_send_and_recieve_data_AIO_connect_a_feed_to_color_picker.png?1646162290)

Finally, a Block Settings page will come up. You can add an optional block title here. Then you press **Create Block**.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/403/medium800/adafruit_io_send_and_recieve_data_AIO_color_picker_block_settings.png?1646162334)

The dashboard should look something like the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/404/medium800/adafruit_io_send_and_recieve_data_AIO_Dashboard_color_picker.png?1646162566)

Now that things are set up on the Adafruit IO end, you can continue on to the code on your microcontroller!

## Adafruit IO settings.toml

This example requires you to provide your Wi-Fi credentials, and your Adafruit IO username and key. To do this, you'll want to create a **settings.toml** file on your **CIRCUITPY** drive.

To obtain your Adafruit IO key, follow [the initial steps on this page](https://learn.adafruit.com/adafruit-io-home-security/adafruit-io-setup).

Your **settings.toml** file should be structured in a certain way, and contain all the necessary information. Follow these instructions to [create your settings.toml file](https://learn.adafruit.com/pico-w-wifi-with-circuitpython/create-your-settings-toml-file).

## Adafruit IO Example Code

To run this example, you need to first install the NeoPixel, Adafruit IO, and Adafruit MiniMQTT libraries into the **lib** folder on your board. Then you need to update **code.py** with the example script.

In the example below, click the&nbsp; **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. You'll see a **code.py** file and **/lib** folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Templates/adafruit_io_cpu_temp_neopixel_color/code.py

## Update the **/lib** Folder
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Folders**.

![adafruit_io_send_and_recieve_data_uploadFolders.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/923/medium640/adafruit_io_send_and_recieve_data_uploadFolders.jpg?1724097455)

Navigate to the project bundle that you downloaded and select the **/lib folder**.

![adafruit_io_send_and_recieve_data_ioLib.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/924/medium640/adafruit_io_send_and_recieve_data_ioLib.jpg?1724097754)

You'll be asked if you want to upload the **/lib** folder from the&nbsp;Project Bundle. Click **Upload**.

![adafruit_io_send_and_recieve_data_ioUpload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/925/medium640/adafruit_io_send_and_recieve_data_ioUpload.jpg?1724097803)

After the upload finishes, you can open the **lib** folder to view the library files required for the Adafruit IO example.

![adafruit_io_send_and_recieve_data_ioLibs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/926/medium640/adafruit_io_send_and_recieve_data_ioLibs.jpg?1724097856)

## Update **code.py**
In the editor window in your browser, click the **Open** button to view the file dialog. Then, click the **Upload** button and select **Upload Files**.

![adafruit_io_send_and_recieve_data_upload.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/927/medium640/adafruit_io_send_and_recieve_data_upload.jpg?1724097889)

Navigate to the project bundle that you downloaded and select the **code.py** file.

![adafruit_io_send_and_recieve_data_code_dot_py.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/928/medium640/adafruit_io_send_and_recieve_data_code_dot_py.jpg?1724097913)

You'll be asked if you want to overwrite the previous **code.py** with the new **code.py** file from the Project Bundle. Click **OK**.

![adafruit_io_send_and_recieve_data_overwrite.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/929/medium640/adafruit_io_send_and_recieve_data_overwrite.jpg?1724097932)

## Update Your **settings.toml** File

Remember to add your **settings.toml** file as described earlier in this page. You'll need to include your `ADAFRUIT_AIO_USERNAME`, `ADAFRUIT_AIO_KEY`, `CIRCUITPY_WIFI_SSID` and `CIRCUITPY_WIFI_PASSWORD` in the file.

You can edit the file manually in the USB code editor by clicking **Open** , selecting **settings.toml** and clicking **Open** at the bottom of the dialog box.

![adafruit_io_send_and_recieve_data_openSettingsDotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/930/medium640/adafruit_io_send_and_recieve_data_openSettingsDotToml.jpg?1724098044)

With **settings.toml** open in the editor, you can add your WiFi and Adafruit IO credentials:

`CIRCUITPY_WIFI_SSID = "your-ssid-here"`  
`CIRCUITPY_WIFI_PASSWORD = "your-ssid-password-here"`  
`ADAFRUIT_AIO_USERNAME = "your-aio-username-here"`  
`ADAFRUIT_AIO_KEY = "your-aio-key-here"`

Once your credentials are entered, click **Save** above the editor to save your changes to **settings.toml**.

![adafruit_io_send_and_recieve_data_ioSettingsToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/931/medium640/adafruit_io_send_and_recieve_data_ioSettingsToml.jpg?1724098221)

Once everything is saved to the&nbsp;board, **Restart** the Serial Console to run the new **code.py**. You'll see the connection info and current readings printed out in the console.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/637/medium800/adafruit_products_repl_adafruitio.png?1737662603)

## NeoPixel Color Change

To change the color of the NeoPixel, go to the NeoPixel Adafruit IO dashboard you created at the beginning, and click on the colored circle in the ColorPicker block. It will bring up the following.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/405/medium800/adafruit_io_send_and_recieve_data_AIO_color_picker_choose_color.png?1646162719)

You can move the dot in the box around, and the slider line across the gradient to choose the perfect color. Choose a new color and click **SAVE**.

The NeoPixel color will update, and you will see the new value printed to the serial console, as shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/433/medium800/adafruit_io_send_and_recieve_data_AIO_template_serial_output_neopixel_color_change.png?1646242768)

## Code Walkthrough

This example contains three `try`/`except` blocks. These are included where the code is likely to fail due to WiFi or Adafruit IO connection failures. WiFi can be finicky, and without these code blocks, if the connection was lost, the code would crash. Instead, it is designed to reset the board and start the code over again to reestablish the connection, regardless of the cause. This ensures your code will continue running. The details of these blocks are explained below.

First you import all of the necessary modules and libraries.

```python
import time
import ssl
import os
from random import randint
import socketpool
import wifi
import board
import neopixel
import adafruit_minimqtt.adafruit_minimqtt as MQTT
from adafruit_io.adafruit_io import IO_MQTT
```

Info: Note that if a **settings.toml** file is not present on your **CIRCUITPY** drive, the code will fail to run, and you will receive an error in the serial console. Add a **settings.toml** file to your **CIRCUITPY** drive to resolve this error.

The WiFi attempts to connect, and prints the status to the serial console. If it connects successfully, the code continues onto the NeoPixel set up.

```python
try:
    print("Connecting to %s" % os.getenv("CIRCUITPY_WIFI_SSID"))
    wifi.radio.connect(os.getenv("CIRCUITPY_WIFI_SSID"), os.getenv("CIRCUITPY_WIFI_PASSWORD"))
    print("Connected to %s!" % os.getenv("CIRCUITPY_WIFI_SSID"))
```

If the WiFi connection is not successful, the error will be printed to the serial console, and the board will hard reset after 30 seconds.

```python
except Exception as e:  # pylint: disable=broad-except
    print("Failed to connect to WiFi. Error:", e, "\nBoard will hard reset in 30 seconds.")
    time.sleep(30)
    microcontroller.reset()
```

Once the WiFi successfully connects, the NeoPixel object is initiated.

```python
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3)
```

Following that are two callback methods. For more details, check out [this guide](https://learn.adafruit.com/mqtt-in-circuitpython/code-walkthrough#minimqtt-callback-methods-3034067-9). The `connected` method subscribes to the neopixel feed on Adafruit IO. The `message` callback checks for updates to the neopixel feed, and turns the pixel the color from the feed.

```python
def connected(client):
    print("Connected to Adafruit IO!  Listening for NeoPixel changes...")
    # Subscribe to Adafruit IO feed called "neopixel"
    client.subscribe("neopixel")


# pylint: disable=unused-argument
def message(client, feed_id, payload):
    print("Feed {0} received new value: {1}".format(feed_id, payload))
    if feed_id == "neopixel":
        pixel.fill(int(payload[1:], 16))
```

You create a socket pool, use that to initialise the new MQTT Client object, and use that to initialise the Adafruit IO MQTT "helper".

```python
pool = socketpool.SocketPool(wifi.radio)

mqtt_client = MQTT.MQTT(
    broker="io.adafruit.com",
    username=os.getenv("ADAFRUIT_AIO_USERNAME"),
    password=os.getenv("ADAFRUIT_AIO_KEY"),
    socket_pool=pool,
    ssl_context=ssl.create_default_context(),
)

io = IO_MQTT(mqtt_client)
```

You set up the callback methods mentioned above.

```python
io.on_connect = connected
io.on_message = message
```

Next, you attempt to connect the client to the MQTT broker. If connection is successful, the code continues on to the `timestamp`.

```python
try:
    io.connect()
```

If the MQTT broker connection is not successful, the error is printed to the serial console, and the board will hard reset after 30 seconds.

```python
except Exception as e:
    print("Failed to connect to Adafruit IO. Error:", e, "\nBoard will hard reset in 30 seconds.")
    time.sleep(30)
    microcontroller.reset()
```

Once the broker is connected, you set the `timestamp` to `0` immediately before the loop.

```python
timestamp = 0
```

Inside the loop, you attempt to do two things. You first explicitly poll the message loop. Check out [this guide](https://learn.adafruit.com/mqtt-in-circuitpython/advanced-minimqtt-usage#minimqtt-loop-3034264-1) for more details on that.

```python
while True:
    try:
        io.loop()
```

Second, you have a block of code that runs every 10 seconds. Inside, you obtain a "random" value between 0-255 inclusive, print it to the serial console, and publish it to an Adafruit IO feed. Finally, you reset timestamp so the block of code knows when another 10 seconds has passed, and runs again.

```python
[...]
        if (time.monotonic() - timestamp) &gt;= 10:
            random_number = "{}".format(randint(0, 255))
            print("Current 'random' number: {}".format(random_number))
            io.publish("random", random_number)
            timestamp = time.monotonic()
```

If at any time WiFi or Adafruit IO disconnects, the code will print the error to the serial console, and the board will hard reset after 30 seconds.

```python
[...]
    except Exception as e:
        print("Failed to get or send data, or connect. Error:", e,
              "\nBoard will hard reset in 30 seconds.")
        time.sleep(30)
        microcontroller.reset()
```

That's all there is to using CircuitPython and Adafruit IO to send data to Adafruit IO, and receive data from it!

# Adafruit Sparkle Motion Mini

## Arduino IDE Setup

We primarily recommend using the ESP32 chipsets with Arduino. Don't forget you will also need to install the SiLabs CP2104 Driver if you are using an ESP32 board with USB-to-Serial converter! (There's no harm in doing it, so we recommend even if you aren't.)

### Install Arduino IDE

The first thing you will need to do is to download the latest release of the Arduino IDE. You will need to&nbsp;be using&nbsp; **version 1.8** &nbsp;or higher for this guide.

[Arduino IDE Download](http://www.arduino.cc/en/Main/Software)
### Install CP2104 / CP2102N USB Driver

Many ESP32 boards have a USB-to-Serial converter that talks to the chip itself, and will need a driver on your computer's operating system. The driver is available for Mac and Windows. It is already built into Linux.

[Click here to download the CP2104 USB Driver](http://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
### Install CH9102 / CH34X USB Driver

Newer ESP32 boards have a different USB-to-serial converter that talks to the chip itself, and will need a driver on your computer's operating system. The driver is available for Mac and Windows. It is already built into Linux.

If you would like more detail, check out [the guide on installing these drivers](https://learn.adafruit.com/how-to-install-drivers-for-wch-usb-to-serial-chips).

[Click here to download the Windows driver](http://www.wch-ic.com/downloads/CH343SER_ZIP.html)
[Click here to download the Mac driver](http://www.wch-ic.com/downloads/CH34XSER_MAC_ZIP.html)
### Install ESP32 Board Support Package from GitHub

For this board, we recommend you _don't_ use 'release' version of Espressif's board support package because the current release doesn't include board support.

Instead we will install the "very latest" [by following these instructions](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#windows-manual-installation) (scroll down for mac and Linux as well

Basically, install by **git clone** ing the Espressif ESP32 board support to get the very latest version of the code.

In the **Tools → Board** submenu you should see **ESP32 Arduino (in sketchbook)** and in that dropdown it should contain the ESP32 boards along with all the latest ESP32 boards.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/605/medium800/esp32_arduino_ide_setup_image.png?1646944312)

Look for the board called Adafruit Sparkle Motion Mini (ESP32).

![](https://cdn-learn.adafruit.com/assets/assets/000/134/556/medium800/adafruit_products_Screenshot_2025-01-21_122754.png?1737480987)

The upload speed can be changed: faster speed makes uploads take less time but sometimes can cause upload issues. **921600** should work fine, but if you're having issues, you can drop down lower.

# Adafruit Sparkle Motion Mini

## Blink

The first and most basic program you can upload to your Arduino is the classic Blink sketch. This takes something on the board and makes it, well, blink! On and off. It's a great way to make sure everything is working and you're uploading your sketch to the right board and right configuration.

When all else fails, you can always come back to Blink!

![](https://cdn-learn.adafruit.com/assets/assets/000/134/655/medium800thumb/adafruit_products_blink.jpg?1737735571)

# Pre-Flight Check: Get Arduino IDE & Hardware Set Up

This lesson assumes you have Arduino IDE set up. This is a generalized checklist, some elements may not apply to your hardware. If you haven't yet, check the previous steps in the guide to make sure you:

- **Install the very latest Arduino IDE for Desktop** (not all boards are supported by the Web IDE so we don't recommend it)
- **Install any board support packages (BSP) required for your hardware.** Some boards are built in defaults on the IDE, but lots are not! You may need to install plug-in support which is called the BSP.
- **Get a Data/Sync USB cable for connecting your hardware.** A _significant_ amount of problems folks have stem from not having a USB cable with data pins. Yes, these cursed cables roam the land, making your life hard. If you find a USB cable that doesn't work for data/sync, _throw it away immediately_! There is no need to keep it around, cables are very inexpensive these days.
- **Install any drivers required** - If you have a board with a FTDI or CP210x chip, you may need to get separate drivers. If your board has native USB, it probably doesn't need anything. After installing, reboot to make sure the driver sinks in.
- **Connect the board to your computer.** If your board has a power LED, make sure it's lit. Is there a power switch? Make sure its turned On!

# Start up Arduino IDE and Select Board/Port

OK now you are prepared! Open the Arduino IDE on your computer. Now you have to tell the IDE what board you are using, and how you want to connect to it.

In the IDE find the **Tools** menu. You will use this to select the board. If you switch boards, you _must switch the selection!_ So always double-check before you upload code in a new session.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/568/medium800/adafruit_products_Screenshot_2025-01-21_164836.png?1737496132)

# New Blink Sketch

OK lets make a new blink sketch! From the **File** menu, select **New**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/498/medium800/blink__image.png?1640454932)

Then in the new window, copy and paste this text:

```auto
int led = LED_BUILTIN;

void setup() {
  // Some boards work best if we also make a serial connection
  Serial.begin(115200);

  // set LED to be an output pin
  pinMode(led, OUTPUT);
}

void loop() {
  // Say hi!
  Serial.println("Hello!");
  
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);                // wait for a half second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(500);                // wait for a half second
}
```

Info: 

One note you'll see is that we reference the LED with the constant `LED_BUILTIN` rather than a number. That's because, historically, the built in LED was on pin 13 for Arduinos. But in the decades since, boards don't always have a pin 13, or maybe it could not be used for an LED. So the LED could have moved to another pin. It's best to use `LED_BUILTIN` so you don't get the pin number confused!

# Verify (Compile) Sketch

OK now you can click the Verify button to convert the sketch into binary data to be uploaded to the board.

Note that Verifying a sketch is the same as Compiling a sketch - so we will use the words interchangeably

![](https://cdn-learn.adafruit.com/assets/assets/000/107/503/medium800/blink__image.png?1640455847)

During verification/compilation, the computer will do a bunch of work to collect all the libraries and code and the results will appear in the bottom window of the IDE

![](https://cdn-learn.adafruit.com/assets/assets/000/107/500/medium800/blink__image.png?1640455335)

If something went wrong with compilation, you will get red warning/error text in the bottom window letting you know what the error was. It will also highlight the line with an error

For example, here I had the wrong board selected - and the selected board does not have a built in LED!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/501/medium800/blink__image.png?1640455513)

Here's another common error, in my haste I forgot to add a `;` at the end of a line. The compiler warns me that it's looking for one - note that the error is actually a few lines up!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/502/medium800/blink__image.png?1640455650)

Info: Turning on detailed compilation warnings and output can be very helpful sometimes - It's in Preferences under "Show Verbose Output During:" and check the Compilation button. If you ever need to get help from others, be sure to do this and then provide all the text that is output. It can assist in determining what happened!

On success you will see something like this white text output and the message **Done compiling.** in the message area.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/504/medium800/blink__image.png?1640455995)

# Upload Sketch

Once the code is verified/compiling cleanly you can upload it to your board. Click the **Upload** button

![](https://cdn-learn.adafruit.com/assets/assets/000/107/499/medium800/blink__image.png?1640455265)

The IDE will try to compile the sketch again for good measure, then it will try to connect to the board and upload a the file.

**This is actually one of the hardest parts for beginners because it's where a lot of things can go wrong.**

However, lets start with what it looks like on success! Here's what your board upload process looks like when it goes right:

![](https://cdn-learn.adafruit.com/assets/assets/000/134/569/medium800/adafruit_products_Screenshot_2025-01-21_165152.png?1737496340)

Often times you will get a warning like this, which is kind of vague:

`No device found on COM66` (or whatever port is selected)  
`An error occurred while uploading the sketch`

![](https://cdn-learn.adafruit.com/assets/assets/000/107/505/medium800/blink__image.png?1640456582)

This could be a few things.

First up, **check again that you have the correct board selected!** Many electronics boards have very similar names or look, and often times folks grab a board different from what they thought.

Second, **make sure you selected the right port!** If you have the wrong port or no port selected, Arduino doesn't know where to look for your board.

If both of those are correct, the next step is to enable verbose upload messages.

Before continuing we _really really_ suggest turning on **Verbose Upload** messages, it will help in this process because you will be able to see what the IDE is trying to do. It's a checkbox in the **Preferences** menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/507/medium800/blink__image.png?1640457254)

Now you can try uploading again!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/506/medium800/blink__image.png?1640457185)

This time, you should have success!

After uploading this way, be sure to **click the reset button** - it sort of makes sure that the board got a good reset and will come back to life nicely.

# Finally, a Blink!

OK it was a journey but now we're here and you can enjoy your blinking LED. Next up, try to change the delay between blinks and re-upload. It's a good way to make sure your upload process is smooth and practiced.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/656/medium800thumb/adafruit_products_blink.jpg?1737735602)

# Adafruit Sparkle Motion Mini

## Built-In NeoPixel

Your board has a built-in RGB NeoPixel status LED. You can use Arduino code to control the color and brightness of this LED. It is also used to indicate the bootloader status.

A NeoPixel is what Adafruit calls the WS281x family of addressable RGB LEDs. It contains three LEDs - a red one, a green one and a blue one - along side a driver chip in a tiny package controlled by a single pin. They can be used individually (as in the built-in LED on your board), or chained together in strips or other creative form factors. NeoPixels do not light up on their own; they require a microcontroller. So, it's super convenient that the NeoPixel is built in to your microcontroller board!

This page will cover using Arduino to control the status RGB NeoPixel built into your microcontroller. Time to get started!

## NeoPixel Location
![](https://cdn-learn.adafruit.com/assets/assets/000/134/625/medium800/adafruit_products_cp_examples_neopixel.png?1737650200)

## Arduino Library Installation

You can install the necessary libraries from the Library Manager. To open, click **Sketch \> Include Library \> Manage Libraries...**

![](https://cdn-learn.adafruit.com/assets/assets/000/132/296/medium800/arduino_rainbow_neopixel_example_Arduino_Open_Library_Manager.png?1726175295)

Search for **NeoPixel** , and install the **Adafruit**  **NeoPixel** library.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/297/medium800/arduino_rainbow_neopixel_example_Screenshot_2024-09-09_095020.png?1726175334)

Info: There are no additional library dependencies for the Adafruit NeoPixel library.

## Rainbow Swirl Demo
```cpp
// SPDX-FileCopyrightText: 2024 ladyada for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include &lt;Adafruit_NeoPixel.h&gt;

#define NUMPIXELS 1
Adafruit_NeoPixel pixel(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);

void setup() {
  Serial.begin(115200);

  pixel.begin();
  pixel.setBrightness(25);
  pixel.show();

}

uint16_t firstPixelHue = 0;

void loop() {  
  firstPixelHue += 256;
  for(int i=0; i&lt;pixel.numPixels(); i++) {
      int pixelHue = firstPixelHue + (i * 65536L / pixel.numPixels());
      pixel.setPixelColor(i, pixel.gamma32(pixel.ColorHSV(pixelHue)));
    }
  pixel.show();
  
  delay(10);

}
```

Upload the sketch to your board. You'll see the onboard NeoPixel run through a looping rainbow animation.

# Adafruit Sparkle Motion Mini

## Arduino Sparkle Motion Demo

![](https://cdn-learn.adafruit.com/assets/assets/000/134/652/medium800thumb/adafruit_products_arduinoSparkle.jpg?1737735404)

The main use of the Sparkle Motion Mini is lighting up RGB LEDs to dazzle and delight. Using the Sparkle Motion Mini with Arduino involves installing the [Adafruit\_NeoPixel](https://github.com/adafruit/Adafruit_NeoPixel)&nbsp;library and running the provided example code. In the example below, you'll attach two NeoPixel strips to the Sparkle Motion Mini and see how you can write code to run two different LED animations on two strips of NeoPixels at the same time.

## Wiring
- **Terminal block G** to **GND** on both NeoPixel strips. (black wire, going through breadboard GND rail)
- **Terminal block 5V** &nbsp;to **VIN** on both NeoPixel strips. (red wire, going through breadboard power rail)
- **Terminal block 33** to **DIN** on the first NeoPixel strip. (green wire)
- **Terminal block 32** to **DIN** on the second NeoPixel strip. (green wire)

![adafruit_products_neopixel_animations_example_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/134/587/medium640/adafruit_products_neopixel_animations_example_bb.png?1737563832)

## Library Installation

You can install the&nbsp; **Adafruit NeoPixel** library&nbsp;for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/588/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1737563951)

Click the&nbsp; **Manage Libraries ...** &nbsp;menu item, search for&nbsp; **Adafruit NeoPixel** &nbsp;and select the&nbsp; **Adafruit NeoPixel** &nbsp;library:

![](https://cdn-learn.adafruit.com/assets/assets/000/134/589/medium800/adafruit_products_neoPixelLibrary.png?1737564000)

Info: No additional dependencies are required for the NeoPixel library.

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Sparkle_Motion_Mini_Examples/Arduino_Sparkle_Motion_Mini_Multi_NeoPixels/Arduino_Sparkle_Motion_Mini_Multi_NeoPixels.ino

Upload the example code to the Sparkle Motion Mini. You'll see both strips cycle through the rainbow swirl, but in a different order on each strip.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/653/medium800thumb/adafruit_products_arduinoSparkle.jpg?1737735421)

# Adafruit Sparkle Motion Mini

## I2C

A lot of sensors, displays, and devices can connect over I2C. I2C is a 2-wire 'bus' that allows multiple devices to all connect on one set of pins so it's very convenient for wiring!

When using your board, you'll probably want to connect up I2C devices, and it can be a little tricky the first time. The best way to debug I2C is go through a checklist and then perform an I2C scan

# Common I2C Connectivity Issues

- **Have you connected four wires (at a minimum) for each I2C device?** Power the device with whatever is the logic level of your microcontroller board (probably 3.3V), then a ground wire, and a SCL clock wire, and and a SDA data wire.
- **If you're using a STEMMA QT board - check if the power LED is lit.** It's usually a green LED to the left side of the board.
- **Does the STEMMA QT/I2C port have switchable power or pullups?** To reduce power, some boards have the ability to cut power to I2C devices or the pullup resistors. Check the documentation if you have to do something special to turn on the power or pullups.
- **If you are using a DIY I2C device, do you have pullup resistors?** Many boards do _not_ have pullup resistors built in and they are _required!_ We suggest any common 2.2K to 10K resistors. You'll need two: one each connects from SDA to positive power, and SCL to positive power. Again, positive power (a.k.a VCC, VDD or V+) is often 3.3V
- **Do you have an address collision?** You can only have _one_ board per address. So you cannot, say, connect two AHT20's to one I2C port because they have the same address and will interfere. Check the sensor or documentation for the address. Sometimes there are ways to adjust the address.
- **Does your board have multiple I2C ports?** Historically, boards only came with one. But nowadays you can have two or even three! This can help solve the "hey, but what if I want two devices with the same address" problem: just put one on each bus.
- **Are you hot-plugging devices?** I2C does _not_ support dynamic re-connection, you cannot connect and disconnect sensors as you please. They should all be connected on boot and not change. ([Only exception is if you're using a hot-plug assistant but that'll cost you](https://www.adafruit.com/product/5159)).
- **Are you keeping the total bus length reasonable?** I2C was designed for maybe 6" max length. We like to push that with plug-n-play cables, but really please keep them as short as possible! ([Only exception is if you're using an active bus extender](https://www.adafruit.com/product/4756)).

# Perform an I2C scan!

### Install TestBed Library

To scan I2C, the Adafruit TestBed library is used. This library and example just makes the scan a little easier to run because it takes care of some of the basics. You will need to add support by installing the library. Good news: it is _very easy_ to do it. Go to the **Arduino Library Manager.**

![](https://cdn-learn.adafruit.com/assets/assets/000/107/555/medium800/i2c_scan_test_installlib.png?1640562425)

Search for **TestBed** and install the **Adafruit TestBed** library

![](https://cdn-learn.adafruit.com/assets/assets/000/107/556/medium800/i2c_scan_test_testbedlib.png?1640562581)

Now open up the I2C Scan example

![](https://cdn-learn.adafruit.com/assets/assets/000/107/557/medium800/i2c_scan_test_i2cscan.png?1640562632)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/I2C_Scanners/arduino/i2c_scanner/i2c_scanner.ino

### Wire up I2C device

While the examples here will be using the [Adafruit MCP9808](https://www.adafruit.com/product/5027), a high accuracy temperature sensor, the overall process is the same for just about any I2C sensor or device.

The first thing you'll want to do is get the sensor connected so your board has I2C to talk to.

### Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout

[Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout](https://www.adafruit.com/product/5027)
The MCP9808 digital temperature sensor is one of the more accurate/precise we've ever seen, with a typical accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°C. They work great with any microcontroller using standard I2C. With...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5027)
[Related Guides to the Product](https://learn.adafruit.com/products/5027/guides)
![Top view of temperature sensor breakout above an OLED display FeatherWing. The OLED display reads "MCP9808 Temp: 24.19ºC"](https://cdn-shop.adafruit.com/640x480/5027-04.jpg)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

## Wiring the MCP9808

The MCP9808 comes with a STEMMA QT connector, which makes wiring it up quite simple and solder-free.

Plug a **STEMMA QT to STEMMA QT cable** into **the port on the Mini Sparkle Motion** &nbsp;and **a port on the MCP9808 breakout**.

![adafruit_products_mini_sparkle_i2c.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/571/medium640/adafruit_products_mini_sparkle_i2c.jpg?1737497589)

Now upload the scanning sketch to your microcontroller and open the serial port to see the output. You should see something like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/134/570/medium800/adafruit_products_Screenshot_2025-01-21_170608.png?1737497185)

# Adafruit Sparkle Motion Mini

## I2S Mic

![](https://cdn-learn.adafruit.com/assets/assets/000/134/639/medium800/adafruit_products_pinouts_mic.png?1737668104)

You can use the onboard I2S microphone with the built-in I2S library in the espressif board support package. The I2S microphone is connected to the following pins on the Sparkle Motion Mini:

- BCLK: 23
- WS: 10
- DATA\_IN: 9

The example below will plot samples from the mic to the plotter inside the Arduino IDE.

Info: No additional libraries need to be installed for this example - the I2S library is included in the Espressif board support package.

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Sparkle_Motion_Mini_Examples/Arduino_I2S_SparkleMotionMini/Arduino_I2S_SparkleMotionMini.ino

Upload the sketch to your board and open up the Serial Plotter ( **Tools -\> Serial Plotter** ) at **500000 baud**. You'll see the raw samples and average samples from the I2S microphone plotted over time.

![](https://cdn-learn.adafruit.com/assets/assets/000/134/624/medium800/adafruit_products_Screenshot_2025-01-23_112022.png?1737650067)

# Adafruit Sparkle Motion Mini

## WiFi Test

Thankfully if you have ESP32 sketches, they'll 'just work' with variations of ESP32. You can find a wide range of examples in the **File-\>Examples-\>Examples for Adafruit Metro ESP32-S2** subheading (the name of the board may vary so it could be **"Examples for Adafruit Feather ESP32 V2"** etc)

![](https://cdn-learn.adafruit.com/assets/assets/000/097/028/medium800/adafruit_products_image.png?1605222761)

Let's start by scanning the local networks.

**Load up the WiFiScan example** under **Examples-\>Examples for YOUR BOARDNAME-\>WiFi-\>WiFiScan**

![](https://cdn-learn.adafruit.com/assets/assets/000/096/993/medium800/adafruit_products_Screen_Shot_2020-11-11_at_12.28.51_PM.png?1605115789)

And **upload this example to your board**. The ESP32 should scan and find WiFi networks around you.

For ESP32, open the serial monitor, to see the scan begin.

For ESP32-S2, -S3 and -C3, don't forget you have to click Reset after uploading through the ROM bootloader. Then select the new USB Serial port created by the ESP32. It will take a few seconds for the board to complete the scan.

![](https://cdn-learn.adafruit.com/assets/assets/000/097/029/medium800/adafruit_products_image.png?1605223012)

If you can not scan any networks, check your power supply. You need a solid power supply in order for the ESP32 to not brown out. A skinny USB cable or drained battery can cause issues.

## WiFi Connection Test

Now that you can scan networks around you, its time to connect to the Internet!

Copy the example below and paste it into the Arduino IDE:

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/ESP32_S2_WiFi_Tests/WiFiWebClient/WiFiWebClient.ino

 **NOTE:** You must **change the `SECRET_SSID` and `SECRET_PASS` in the example code to your WiFi SSID and password** before uploading this to your board.

![](https://cdn-learn.adafruit.com/assets/assets/000/097/030/medium800/adafruit_products_image.png?1605223125)

After you've set it correctly, upload and check the serial monitor. You should see the following. If not, go back, check wiring, power and your SSID/password

![](https://cdn-learn.adafruit.com/assets/assets/000/097/009/medium800/adafruit_products__dev_cu_usbmodem14101.png?1605127946)

Info: If you have issues establishing a connection, try power cycling the board by unplugging and replugging the USB cable.

# Adafruit Sparkle Motion Mini

## Factory Reset

Your microcontroller ships running a factory demo. It's lovely, but you probably had other plans for the board. As you start working with your board, you may want to return to the original code to begin again, or you may find your board gets into a bad state. Either way, this page has you covered.

## Factory Reset Example Code
If you're still able to load Arduino sketches, you can load the following sketch onto your board to return it to its original state.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Factory_Tests/Adafruit_Sparkle_Motion_Mini_FactoryTest/Adafruit_Sparkle_Motion_Mini_FactoryTest.ino

Your board is now back to its factory-shipped state! You can now begin again with your plans for your board.

## Factory Reset .bin
If your board is in a state where Arduino isn't working, you may need to use these tools to flash a .bin file directly onto your board.

There are two ways to do a factory reset. The first is using WebSerial through a Chromium-based browser, and the second is using `esptool` via command line. **We highly recommend using WebSerial through Chrome/Chromium.**

First you'll need to download the factory-reset.bin file. Save the following file wherever is convenient for you. You'll need access to it for both tools.

[Click to download Adafruit Mini Sparkle Motion Factory Reset .BIN File](https://github.com/adafruit/Adafruit-Mini-Sparkle-Motion-PCB/raw/main/factory-reset/Adafruit_Mini_Sparkle_Motion_FactoryReset.bin)
Now that you've downloaded the .bin file, you're ready to continue with the factory reset process. The next two sections walk you through using WebSerial and `esptool`.

## The WebSerial ESPTool Method
Primary: 

This method uses the WebSerial ESPTool through Chrome or a Chromium-based browser. The WebSerial ESPTool was designed to be a web-capable option for programming ESP32 boards. It allows you to erase the contents of the microcontroller and program up to four files at different offsets.

You will have to use a Chromium browser (like Chrome, Opera, Edge...) for this to work, Safari and Firefox, etc. are _not_ supported because we need Web Serial and only Chromium is supporting it to the level needed.

Follow the steps to complete the factory reset.

Warning: 

### Connect

You should have plugged in **only the ESP32 that you intend to flash**. That way there's no confusion in picking the proper port when it's time!

In the **Chrome browser** visit [https://adafruit.github.io/Adafruit\_WebSerial\_ESPTool/](https://adafruit.github.io/Adafruit_WebSerial_ESPTool/). You should see something like the image shown.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.07.03_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/492/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.07.03_PM.png?1649110083)

Press the&nbsp; **Connect** &nbsp;button in the top right of the web browser. You will get a pop up asking you to select the COM or Serial port.

**Remember, you should remove all other USB devices so**  **_only_ the ESP32 board is attached, that way there's no confusion over multiple ports!**

On some systems, such as MacOS, there may be additional system ports that appear in the list.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.12.49_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/493/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.12.49_PM.png?1649110453)

The Javascript code will now try to connect to the ROM bootloader. It may timeout for a bit until it succeeds. On success, you will see that it is&nbsp; **Connected** &nbsp;and will print out a unique&nbsp; **MAC address** identifying the board along with other information that was detected.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.16.00_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/494/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.16.00_PM.png?1649110590)

&nbsp;

&nbsp;

Once you have successfully connected, the command toolbar will appear.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.18.26_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/496/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.18.26_PM.png?1649110775)

### Erase the Contents
To erase the contents, click the Erase button. You will be prompted whether you want to continue. Click OK to continue or if you changed your mind, just click cancel.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.19.58_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/497/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.19.58_PM.png?1649110871)

&nbsp;

You'll see "Erasing flash memory. Please wait..." This will eventually be followed by "Finished." and the amount of time it took to erase.

**Do not disconnect!** Immediately continue on to programming the ESP32.

![factory_reset___esp32_s2_WebSerial_ESPTool_erase_board_text.png](https://cdn-learn.adafruit.com/assets/assets/000/106/947/medium640/factory_reset___esp32_s2_WebSerial_ESPTool_erase_board_text.png?1638491869)

Danger: 

### Program the ESP32
Programming the microcontroller can be done with up to four files at different locations, but with the board-specific **factory-reset.bin** file, which you should have downloaded earlier, you only need to use one file.

Click on the first **Choose a file...**. (The tool will only attempt to program buttons with a file and a unique location.) Then, select the \*- **factory-reset.bin** file you downloaded in Step 1 that matches your board.

Verify that the&nbsp; **Offset** &nbsp;box next to the file location you used is (0x) **0**.

![install_uf2_bootloader_adafruit_products_image_(3).png](https://cdn-learn.adafruit.com/assets/assets/000/101/574/medium640/install_uf2_bootloader_adafruit_products_image_%283%29.png?1618608677)

Once you choose a file, the button text will change to match your filename. You can then select the **Program** button to begin flashing.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.22.13_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/500/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.22.13_PM.png?1649111131)

A progress bar will appear and after a minute or two, you will have written the firmware.

![esp32_factory_reset_Screen_Shot_2022-04-04_at_3.23.42_PM.png](https://cdn-learn.adafruit.com/assets/assets/000/110/499/medium640/esp32_factory_reset_Screen_Shot_2022-04-04_at_3.23.42_PM.png?1649111082)

Once completed, you can skip down to the section titled Reset the Board.

## The `esptool` Method (for advanced users)
Danger: 

Alternatively, you can [use Espressif's esptool program](https://github.com/espressif/esptool)&nbsp;to communicate with the chip!&nbsp;`esptool`&nbsp;is the 'official' programming tool and is the most common/complete way to program an ESP chip.

### Install ESPTool.py

You will need to use the command line / Terminal to install and run&nbsp;`esptool`.

You will also need to have pip and Python installed (any version!).

Install the latest version using pip (you may be able to run&nbsp;`pip`&nbsp;without the&nbsp;`3`&nbsp;depending on your setup):

`pip3 install --upgrade esptool`

Then, you can run:

`esptool.py`

### Test the Installation

Run&nbsp;`esptool.py`&nbsp;in a new terminal/command line and verify you get something like the below:

![](https://cdn-learn.adafruit.com/assets/assets/000/109/599/medium800/esp32_factory_reset_ESP_factory_reset_esptool_verify.png?1646862954)

### Connect

Run the following command, replacing the `COM88` identifier after&nbsp;`--port`&nbsp;with the&nbsp;`COMxx`,&nbsp;`/dev/cu.usbmodemxx`&nbsp;or&nbsp;`/dev/ttySxx`&nbsp;you found above.

`esptool.py --port COM88 chip_id`

You should get a notice that it connected over that port and found an ESP32.

![](https://cdn-learn.adafruit.com/assets/assets/000/109/600/medium800/esp32_factory_reset_ESP_factory_reset_esptool_connect.png?1646862962)

### Installing the Factory Test file

Run this command and replace the serial port name, `COM88`, with your matching port and `*-factory-reset.bin` with file you just downloaded

`esptool.py --port COM88 write_flash 0x0 *-factory-reset.bin`

Don't forget to change the `--port` name to match.

There might be a bit of a 'wait' when programming, where it doesn't seem like it's working. Give it a minute, it has to erase the old flash code which can cause it to seem like it's not running.

You'll finally get an output like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/109/601/medium800/esp32_factory_reset_ESP_factory_reset_esptool_install.png?1646862974)

Once completed, you can continue to the next section.

## Reset the board
Now that you've reprogrammed the board, you need to reset it to continue. Click the reset button to launch the new firmware.

Info: 

The NeoPixel LED on the Sparkle Motion Mini will light up with a rainbow swirl. If you open the Serial Monitor in the Arduino IDE, you'll see a WiFi scan print out, followed by an amplitude reading from the I2S mic and an I2C scan on the STEMMA QT port.

You've successfully returned your board to a factory reset state!

## Older Versions of Chrome
Primary: 

We suggest updating to Chrome 89 or newer, as Web Serial is enabled by default.

If you must continue using an older version of Chrome, follow these steps to enable Web Serial.

If you receive an error like the one shown when you visit the WebSerial ESPTool site, you're likely running an older version of Chrome.

**You must be using Chrome 78 or later to use Web Serial.**

![factory_reset___esp32_s2_WebSerial_ESPTool_Not_Supported_Error.png](https://cdn-learn.adafruit.com/assets/assets/000/106/929/medium640/factory_reset___esp32_s2_WebSerial_ESPTool_Not_Supported_Error.png?1638484333)

To enable Web Serial in Chrome versions 78 through 88:

- Visit **chrome://flags** &nbsp;from within Chrome.
- Find and enable the&nbsp; **Experimental Web Platform features**
- **Restart Chrome**

![install_uf2_bootloader_adafruit_products_Enable_Features.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/562/medium640/install_uf2_bootloader_adafruit_products_Enable_Features.jpg?1618608210)

# Adafruit Sparkle Motion Mini

## Downloads

## Files

- [ESP32 datasheet](https://cdn-learn.adafruit.com/assets/assets/000/109/588/original/esp32-pico-mini-02_datasheet_en.pdf?1646852017)
- [CH343DS1 datasheet](https://cdn-learn.adafruit.com/assets/assets/000/134/549/original/CH343DS1.PDF?1737477957)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-Mini-Sparkle-Motion-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20Mini%20Sparkle%20Motion.fzpz)
- [PrettyPins pinout PDF](https://github.com/adafruit/Adafruit-Mini-Sparkle-Motion-PCB/blob/main/Adafruit%20Mini%20Sparkle%20Motion%20PrettyPins.pdf)
- [PrettyPins pinout SVG](https://github.com/adafruit/Adafruit-Mini-Sparkle-Motion-PCB/blob/main/Adafruit%20Mini%20Sparkle%20Motion%20PrettyPins.svg)
- [3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/6160%20Sparkle%20Motion%20Mini)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/134/497/medium800/adafruit_products_schem.png?1737042364)

![](https://cdn-learn.adafruit.com/assets/assets/000/134/498/medium800/adafruit_products_fab.png?1737042465 dimensions are in inches)

## 3D Model
![](https://cdn-learn.adafruit.com/assets/assets/000/134/839/medium800/adafruit_products_6160_Sparkle_Motion_Mini.jpg?1738014823)


## Primary Products

### Mini Sparkle Motion - WLED-friendly ESP32 NeoPixel LED Driver

[Mini Sparkle Motion - WLED-friendly ESP32 NeoPixel LED Driver](https://www.adafruit.com/product/6160)
The **Adafruit Sparkle Motion Mini** &nbsp;is part of our&nbsp;series of "Sparkle Motion" boards, that are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/6160)
[Related Guides to the Product](https://learn.adafruit.com/products/6160/guides)
### Mini Sparkle Motion with Pre-soldered Terminal Block

[Mini Sparkle Motion with Pre-soldered Terminal Block](https://www.adafruit.com/product/6314)
The **Adafruit Sparkle Motion Mini** &nbsp;is part of our&nbsp;series of "Sparkle Motion" boards, which are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/6314)
[Related Guides to the Product](https://learn.adafruit.com/products/6314/guides)

## Featured Products

### 2.54mm/0.1" Pitch Terminal Block - 4-pin

[2.54mm/0.1" Pitch Terminal Block - 4-pin](https://www.adafruit.com/product/2137)
After a long day out harvesting in the terminal block fields, we've returned with a veritable bounty of these very nice and compact 2.54mm/0.1" terminal blocks in a variety of sizes.

Our harvest of terminal blocks is great news&nbsp;since nothing makes a project harder to...

In Stock
[Buy Now](https://www.adafruit.com/product/2137)
[Related Guides to the Product](https://learn.adafruit.com/products/2137/guides)
### Adafruit NeoPixel Digital RGB LED Strip - Black 30 LED 1m

[Adafruit NeoPixel Digital RGB LED Strip - Black 30 LED 1m](https://www.adafruit.com/product/2552)
You thought it couldn't get better than [our world-famous 32-LED-per-meter Digital LED strip](http://adafruit.com/products/306) but we will prove you wrong! These NeoPixel strips have 30 digitally-addressable pixel LEDs per meter and are very affordable and are only 12.5 mm...

In Stock
[Buy Now](https://www.adafruit.com/product/2552)
[Related Guides to the Product](https://learn.adafruit.com/products/2552/guides)
### Adafruit NeoPixel Pebble / Seed LED Strand - 300 LEDs - 2" Pitch

[Adafruit NeoPixel Pebble / Seed LED Strand - 300 LEDs - 2" Pitch](https://www.adafruit.com/product/6023)
We have all&nbsp;sorts of LED strips for a wide range of needs.&nbsp;[_Chonky_](https://www.adafruit.com/product/3869)&nbsp;strips? We got those!&nbsp;[Strips with alligator...](https://www.adafruit.com/?q=neopixel%20alligator%20clips%20stripping%20wires)

In Stock
[Buy Now](https://www.adafruit.com/product/6023)
[Related Guides to the Product](https://learn.adafruit.com/products/6023/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

In Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
### STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm](https://www.adafruit.com/product/3894)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" female header sockets on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3894)
[Related Guides to the Product](https://learn.adafruit.com/products/3894/guides)
### 3-pin JST SM Plug + Receptacle Cable Set

[3-pin JST SM Plug + Receptacle Cable Set](https://www.adafruit.com/product/1663)
These 3-wire cables are 163mm (6.4") long and come as a set. One cable has a JST SM type connector plug on the end. The other cable has a matching JST SM type receptacle connector. They are good for whenever you have 3 wires you want to be able to plug and unplug. We like the solid and...

In Stock
[Buy Now](https://www.adafruit.com/product/1663)
[Related Guides to the Product](https://learn.adafruit.com/products/1663/guides)
### USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs

[USB Battery Pack for Raspberry Pi - 10000mAh - 2 x 5V outputs](https://www.adafruit.com/product/1566)
A large-sized rechargeable battery pack for your [Raspberry Pi](http://www.adafruit.com/raspberrypi) (or [Arduino](http://www.adafruit.com/arduino), or [Propeller](http://www.adafruit.com/category/26), or anything else that uses 5V!). This pack is intended for...

In Stock
[Buy Now](https://www.adafruit.com/product/1566)
[Related Guides to the Product](https://learn.adafruit.com/products/1566/guides)
### Wall Power Supply with USB C - 5V 3A Output and Switch

[Wall Power Supply with USB C - 5V 3A Output and Switch](https://www.adafruit.com/product/5802)
We love the Raspberry Pi 4 and 5, with their fancy new USB Type C power connectors. Now we have an even&nbsp;_better_&nbsp;power supply that can be used with either Pi 4 or even a Pi 5 with 5V output, 3A of current to handle builds with accessories and displays. This flat square body...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5802)
[Related Guides to the Product](https://learn.adafruit.com/products/5802/guides)

## Related Guides

- [LED Festival Coat with Mapping and WLED ](https://learn.adafruit.com/led-festival-coat-with-mapping-and-wled.md)
- [Adafruit Sparkle Motion](https://learn.adafruit.com/adafruit-sparkle-motion.md)
- [Sparkle Motion Skirt with 2D Mapping](https://learn.adafruit.com/sparkle-motion-skirt-with-2d-mapping.md)
- [Adafruit Sparkle Motion Stick](https://learn.adafruit.com/adafruit-sparkle-motion-stick.md)
- [Jellyfish Umbrella with easy WLED WiFi Control](https://learn.adafruit.com/jellyfish-umbrella-with-easy-wled-wifi-control.md)
- [Ever-Burning Flame Painting](https://learn.adafruit.com/ever-burning-flame-painting.md)
- [Adafruit Metro M4 Express featuring ATSAMD51](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51.md)
- [Adafruit LPS25 and LPS22 Barometric Pressure and Temperature Sensors](https://learn.adafruit.com/adafruit-lps25-pressure-sensor.md)
- [Introducing Pro Trinket](https://learn.adafruit.com/introducing-pro-trinket.md)
- [Arcade Fightstick](https://learn.adafruit.com/arcade-fightstick.md)
- [MEMENTO Wireless Remote with TouchOSC](https://learn.adafruit.com/memento-wireless-remote.md)
- [Magic Band Teardown](https://learn.adafruit.com/magic-band-teardown.md)
- [Make a Guggenhat: Bluetooth-connected wearable NeoPixel marquee hat](https://learn.adafruit.com/guggenhat-bluetooth-le-wearable-neopixel-marquee-scrolling-led-hat-display.md)
- [Introducing Adafruit Feather RP2040](https://learn.adafruit.com/adafruit-feather-rp2040-pico.md)
- [I2C/SPI LCD Backpack](https://learn.adafruit.com/i2c-spi-lcd-backpack.md)
