# NeoPixel Sprite Weather Display

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/117/171/medium800/projects_edited_P1390358.jpg?1671477696)

With all of the weather API's and display options, it can be overwhelming to decide which approach to take when building a weather display. This project takes the less is more, or _smol_ is more, approach.

You can use the tiny yet mighty 5x5 NeoPixel Grid BFF add-on board with a QT Py ESP32-S2 to display the current weather conditions and temperature. The CircuitPython code is using the [Open-Meteo API](https://open-meteo.com/en) to fetch current weather data. Open-Meteo is a free and open-source weather API that does not require an API key, making it fast to get started with.

The current weather condition is shown with a 5x5 sprite on the NeoPixel Grid. There are sprites for sunny, partly cloudy, clouds, rain, thunderstorms and snow with day and night versions for each.

![projects_allSprites.gif](https://cdn-learn.adafruit.com/assets/assets/000/117/158/medium640thumb/projects_allSprites.jpg?1671469094)

The current temperature scrolls across the display after showing the sprite. The color of the text changes depending on the temperature. Lower temperatures are represented with cooler colors (green, blue and purple) and higher temperatures are represented with warmer colors (yellow, orange and red).

![projects_rainyNoColor.gif](https://cdn-learn.adafruit.com/assets/assets/000/117/159/medium640thumb/projects_rainyNoColor.jpg?1671469222)

## Prerequisite Guides
[Adafruit QT Py ESP32-S2](https://learn.adafruit.com/adafruit-qt-py-esp32-s2)
[Adafruit 5x5 NeoPixel Grid BFF](https://learn.adafruit.com/adafruit-5x5-neopixel-grid-bff)
[How To Solder Headers](https://learn.adafruit.com/how-to-solder-headers)
## Parts
### Adafruit QT Py ESP32-S2 WiFi Dev Board with STEMMA QT

[Adafruit QT Py ESP32-S2 WiFi Dev Board with STEMMA QT](https://www.adafruit.com/product/5325)
What has your favorite Espressif WiFi microcontroller, comes with&nbsp;[our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C port, and has lots of Flash and RAM memory for your next IoT project? What will make your next IoT project flyyyyy? What a...

In Stock
[Buy Now](https://www.adafruit.com/product/5325)
[Related Guides to the Product](https://learn.adafruit.com/products/5325/guides)
![Angled shot of small square purple dev board.](https://cdn-shop.adafruit.com/640x480/5325-12.jpg)

### Adafruit 5x5 NeoPixel Grid BFF Add-On for QT Py and Xiao

[Adafruit 5x5 NeoPixel Grid BFF Add-On for QT Py and Xiao](https://www.adafruit.com/product/5646)
Our QT Py boards are a great way to make very small microcontroller projects that pack a ton of power - and now we have a way for you to quickly add a glittering grid of 25 RGB addressable&nbsp;micro NeoPixels. It's an excellent way to make tiny wearable, cosplay, or IoT projects with...

In Stock
[Buy Now](https://www.adafruit.com/product/5646)
[Related Guides to the Product](https://learn.adafruit.com/products/5646/guides)
![Video of a 5x5 LED matrix glowing heart and text: "A D A F R U I T"](https://cdn-shop.adafruit.com/product-videos/640x480/5646-05.jpg)

### Break-away 0.1" 36-pin strip male header - Rainbow Combo 10 Pack

[Break-away 0.1" 36-pin strip male header - Rainbow Combo 10 Pack](https://www.adafruit.com/product/4154)
In this world, nothing can be said to be certain, except we need headers, headers, and&nbsp;_more headers_!

Each pack contains ten candy-colored&nbsp; **36-pin&nbsp;0.1" pitch break-away male headers.** &nbsp; These are a little extra special in that the plastic...

In Stock
[Buy Now](https://www.adafruit.com/product/4154)
[Related Guides to the Product](https://learn.adafruit.com/products/4154/guides)
![Break-away 0.1 inch 36-pin strip male header - Five different color plastics](https://cdn-shop.adafruit.com/640x480/4154-01.jpg)

### 20-pin 0.1" Female Headers - Rainbow Color Mix - 5 pack

[20-pin 0.1" Female Headers - Rainbow Color Mix - 5 pack](https://www.adafruit.com/product/4160)
Female header is like the duct tape of electronics. It's great for connecting things together, soldering to perf-boards, sockets for wires or break-away header, etc. We go through these real fast, and thought that given how handy they are, we'd offer them in a pack of five!

Each...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4160)
[Related Guides to the Product](https://learn.adafruit.com/products/4160/guides)
![20-pin 0.1 inch Female Headers - Rainbow Color Mix Plastic - 5 pack](https://cdn-shop.adafruit.com/640x480/4160-00.jpg)

### Pink and Purple Woven USB A to USB C Cable - 1 meter long

[Pink and Purple Woven USB A to USB C Cable - 1 meter long](https://www.adafruit.com/product/5153)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;&nbsp;[If you want something just like it but for Micro B, we...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5153)
[Related Guides to the Product](https://learn.adafruit.com/products/5153/guides)
![Angled shot of coiled pink and purple USB cable with USB A and USB C connectors.](https://cdn-shop.adafruit.com/640x480/5153-02.jpg)

# NeoPixel Sprite Weather Display

## 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. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## CircuitPython Quickstart

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

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

Save it wherever is convenient for you.

![install_circuitpython_on_most_boards_CircuitPython_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/129/medium640/install_circuitpython_on_most_boards_CircuitPython_downloaded.jpg?1620922559)

![](https://cdn-learn.adafruit.com/assets/assets/000/107/612/medium800/adafruit_products_QTESP_reset_NeoPixel.jpg?1641246436)

Info: The board above has a chip antenna, not the u.Fl connector, but the process is the same.

Plug your board into your computer, using a known-good data-sync cable, directly, or via an adapter if needed.

Click the **reset** button once (highlighted in red above), and then click it again when you see the **RGB status LED(s)** (highlighted in green above) turn purple (approximately half a second later). Sometimes it helps to think of it as a "slow double-click" of the reset button.

If you do not see the LED turning purple, you will need to reinstall the UF2 bootloader. See the&nbsp; **Factory Reset** &nbsp;page in this guide for details.

On some very old versions of the UF2 bootloader, the status LED turns red instead of purple.

For this board, tap reset and wait for the LED to turn purple, and as soon as it turns purple, tap reset again. The second tap needs to happen while the LED is still purple.

Once successful, you will see the **RGB status LED(s)** turn green (highlighted in green above), and a disk drive ending in " **...BOOT**" should appear on your host computer. If you see red, try another port, or if you're using an adapter or hub, try without the hub, or different adapter or hub.

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

A lot of people end up using charge-only USB cables and it is very frustrating! **Make sure you have a USB cable you know is good for data sync.**

Info: 

You will see a new disk drive appear called **QTPYS2BOOT**.

&nbsp;

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to **QTPYS2BOOT**.

![adafruit_products_uf2install.png](https://cdn-learn.adafruit.com/assets/assets/000/107/577/medium640/adafruit_products_uf2install.png?1640641747)

Copy or drag the UF2 file you downloaded to the **BOOT** drive.

The **BOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it!

![install_circuitpython_on_most_boards_CIRCUITPY.jpg](https://cdn-learn.adafruit.com/assets/assets/000/102/130/medium640/install_circuitpython_on_most_boards_CIRCUITPY.jpg?1620923145)

# NeoPixel Sprite Weather Display

## Create Your settings.toml File

CircuitPython works with WiFi-capable boards to enable you to make projects that have network connectivity. This means working with various passwords and API keys. As of [CircuitPython 8](https://circuitpython.org/downloads), there is support for a **settings.toml** file. This is a file that is stored on your **CIRCUITPY** drive, that contains all of your secret network information, such as your SSID, SSID password and any API keys for IoT services. It is designed to separate your sensitive information from your **code.py** file so you are able to share your code without sharing your credentials.

CircuitPython previously used a **secrets.py** file for this purpose. The **settings.toml** file is quite similar.

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

## CircuitPython **settings.toml** File

This section will provide a couple of examples of what your **settings.toml** file should look like, specifically for CircuitPython WiFi projects in general.

The most minimal **settings.toml** file must contain your WiFi SSID and password, as that is the minimum required to connect to WiFi. Copy this example, paste it into your **settings.toml** , and update:

- `your_wifi_ssid`
- `your_wifi_password`

```auto
CIRCUITPY_WIFI_SSID = "your_wifi_ssid"
CIRCUITPY_WIFI_PASSWORD = "your_wifi_password"
```

Many CircuitPython network-connected projects on the Adafruit Learn System involve using Adafruit IO. For these projects, you must _also_ include your Adafruit IO username and key. Copy the following example, paste it into your settings.toml file, and update:

- `your_wifi_ssid`
- `your_wifi_password`
- `your_aio_username`
- `your_aio_key`

```auto
CIRCUITPY_WIFI_SSID = "your_wifi_ssid"
CIRCUITPY_WIFI_PASSWORD = "your_wifi_password"
ADAFRUIT_AIO_USERNAME = "your_aio_username"
ADAFRUIT_AIO_KEY = "your_aio_key"
```

Some projects use different variable names for the entries in the **settings.toml** file. For example, a project might use `ADAFRUIT_AIO_ID` in the place of `ADAFRUIT_AIO_USERNAME`. **If you run into connectivity issues, one of the first things to check is that the names in the settings.toml file match the names in the code.**

Warning: Not every project uses the same variable name for each entry in the **settings.toml** file! Always verify it matches the code.

## **settings.toml** File Tips
Here is an example **settings.toml** 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 **settings.toml** file, it's important to keep these factors in mind:

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

- Use `\u` escapes for weird characters, `\x` and `\ooo` escapes are not available in **.toml** files
  - Example: `\U0001f44d` for 👍 (thumbs up emoji) and `\u20ac` 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

&nbsp;

&nbsp;

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

![adafruit_products_dotToml.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/071/medium640/adafruit_products_dotToml.jpg?1671034293)

## Accessing Your **settings.toml** Information in **code.py**
In your **code.py** file, you'll need to `import` the `os` library to access the **settings.toml** file. Your settings are accessed with the `os.getenv()` function. You'll pass your settings entry to the function to import it into the **code.py** file.

```python
import os

print(os.getenv("test_variable"))
```

![](https://cdn-learn.adafruit.com/assets/assets/000/117/072/medium800/adafruit_products_tomlOutput.jpg?1671034496)

In the upcoming CircuitPython WiFi examples, you'll see how the **settings.toml&nbsp;** file is used for connecting to your SSID and accessing your API keys.

# NeoPixel Sprite Weather Display

## Environment Variables Docs

# NeoPixel Sprite Weather Display

## Code the Weather Display

Once you've finished setting up your QT Py ESP32-S2 with CircuitPython, you can access the code and necessary libraries by downloading the Project Bundle.

To do this, click on the **&nbsp;Download Project Bundle** &nbsp;button in the window below. It will download as a zipped folder.

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

## Upload the Code and Libraries to the QT Py ESP32-S2

After downloading the Project Bundle, plug your QT Py ESP32-S2 into the computer's USB port with a known good USB data+power cable. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called&nbsp; **CIRCUITPY**. Unzip the folder and copy the following items to the QT Py ESP32-S2's&nbsp; **CIRCUITPY** &nbsp;drive.&nbsp;

- **lib** &nbsp;folder
- **code.py**
- **weather\_codes.py**

Your QT Py ESP32-S2&nbsp; **CIRCUITPY&nbsp;** drive should look like this after copying the&nbsp; **lib** &nbsp;folder, **weather\_codes.py** file and the&nbsp; **code.py&nbsp;** file.

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/NeoPixel_Sprite_Weather_Display.png )

## Add Your&nbsp; **settings.toml** File

As of CircuitPython 8.0.0, there is support for&nbsp;[Environment Variables](https://docs.circuitpython.org/en/latest/docs/environment.html). These Environmental Variables are stored in a **settings.toml** &nbsp;file. Similar to&nbsp; **secrets.py** , the **settings.toml**** &nbsp; **file separates your sensitive information from your main&nbsp;** code.py **&nbsp;file. Add your** settings.toml**&nbsp;file as described in the&nbsp;[Create Your settings.toml File page](https://learn.adafruit.com/neopixel-sprite-weather-display/create-your-settings-toml-file) earlier in this guide. You'll need to include your `CIRCUITPY_WIFI_SSID`&nbsp;and&nbsp;`CIRCUITPY_WIFI_PASSWORD`.

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

## The **weather\_codes.py** File

The **weather\_codes.py** file is a helper file that contains the sprite information and assigns the sprites to the weather condition codes that will be returned from Open-Meteo.&nbsp;

The file begins by defining RGB color values that will be used to create the sprites.

```python
y = (255, 125, 0)
o = (0, 0, 0)
a = (0, 75, 125)
w = (255, 255, 255)
v = (127, 0, 255)
b = (0, 0, 255)
z = (0, 0, 25)
g = (25, 25, 25)
```

The sprites are defined as five by five arrays. In total, there are eleven sprite arrays.

```auto
sun_bitmap = [
    y,a,y,a,y,
    a,y,y,y,a,
    y,y,y,y,y,
    a,y,y,y,a,
    y,a,y,a,y,
]
cloud_bitmap = [
    a,a,a,w,a,
    a,w,w,w,a,
    a,w,w,w,a,
    a,a,w,w,a,
    a,a,a,w,a,
]
# etc
```

`weather_codes` is a dictionary that contains the weather codes and the associated daytime and nighttime sprite. The codes are [WMO Codes as defined by NOAA](https://www.nodc.noaa.gov/archive/arc0021/0002199/1.1/data/0-data/HTML/WMO-CODE/WMO4677.HTM). There are 100 possible codes, ranging from `0` to `99`. In **code.py** , these weather codes are used as indexes to access the appropriate sprite.

```python
weather_codes = [
{"code" : 0, "day_img" : sun_bitmap, "night_img" : night_bitmap},
{"code" : 1, "day_img" : sun_bitmap, "night_img" : night_bitmap},
{"code" : 2, "day_img" : sun_bitmap, "night_img" : night_bitmap},
  ...
{"code" : 99, "day_img" : thunder_bitmap, "night_img" : nightThunder_bitmap}
]
```

## How the CircuitPython Code Works

At the top of the code are variables that can be edited to customize your **code.py** file for your needs. `min_temp` and `max_temp` are used in the `map_range()` function that determine the color of the temperature text. The `min_temp` number can be negative if you are in a colder climate. `daytime_min` and `daytime_max` are used to determine the hours in which a daytime sprite is shown versus a nighttime sprite. `lat` and `long` hold your location's latitude and longitude. Finally, `temperature_unit` and `temp_unit` hold either Fahrenheit or Celsius.&nbsp;

```python
# minimum expected temperature
min_temp = 0
# maximum expected temperature
max_temp = 100
# first daylight hour
daytime_min = 7
# last daylight hour
daytime_max = 17
# latitude
lat = 42.36
# longitude
long = -71.06
# temp unit for API request
temperature_unit = "fahrenheit"
# temp unit for display
temp_unit = "F"
```

## The Request URL

The API request to Open-Meteo is passed as a URL. `lat`, `long` and `temperature_unit` are passed to the URL string. [Open-Meteo has documentation](https://open-meteo.com/en/docs#api_form) with more information on building a URL for an API request.

```python
# API request to open-meteo
weather_url = "https://api.open-meteo.com/v1/forecast?"
# pass latitude and longitude
weather_url += "latitude=%d&amp;longitude=%d&amp;timezone=auto" % (lat, long)
# pass temperature_unit
weather_url += "¤t_weather=true&amp;temperature_unit=%s&amp;windspeed_unit=mph" % temperature_unit
```

## Get the Weather

The function `get_the_weather()` is used to make the API request and return values for the current weather condition, temperature, the color mapped to the current temperature and the current time.

```python
def get_the_weather():
    # make the API request
    response = requests.get(weather_url)
    # packs the response into a JSON
    response_as_json = response.json()
    print()
    # prints the entire JSON
    print(response_as_json)
    print()
    # gets current weather code
    w = int(response_as_json['current_weather']['weathercode'])
    # gets temperature
    t = response_as_json['current_weather']['temperature']
    temp_int = int(t)
    t_c = simpleio.map_range(temp_int, min_temp, max_temp, 255, 0)
    # gets time
    json_time = response_as_json['current_weather']['time']
    n_t = json_time.rsplit("T", 1)[-1]
    n_t = int(n_t[:2])
    return w, t, t_c, n_t

# initial API call
weather, temp, temp_color, new_time = get_the_weather()
```

## Import the Sprites

A `for` statement packs the list entries from `weather_codes` into three different arrays: `codes` for the weather code numbers, `day_images` for the daytime sprites and `night_images` for the nighttime sprites.

```python
for i in weather_codes:
    codes.append(i['code'])
    day_images.append(i['day_img'])
    night_images.append(i['night_img'])
```

## Day or Night?

The function `day_or_night()` determines which sprite is shown based on the weather condition and time of day.

```python
# checks if it's day or night based on hour
def day_or_night(t):
    if t in range(daytime_min, daytime_max):
        z = day_images[weather]
    else:
        z = night_images[weather]
    return z

# initial sprite selection
img = day_or_night(new_time)
```

## Draw the Sprite

The `draw_sprite()` function draws the weather sprite to the 5x5 grid of NeoPixels.

```python
# draw bitmap sprite
def draw_sprite(c):
    for pixel in img:
        pixels[c] = pixel
        pixels.show()
        c += 1
        time.sleep(0.001)
    c = 0
```

## Tick, tick, tick...

For tracking time, the `ticks` library is used. `ticks` manages time in milliseconds, rather than seconds like in `time.monotonic()`. The API will be called every fifteen minutes, or every `900000` milliseconds.

```python
# ticks time tracker
clock = ticks_ms()

# 15 minutes in milliseconds
weather_check = 900000
```

## The Loop

In the loop, the API is called every 15 minutes. The sprite and scrolling temperature text is updated depending on the data that is returned.

```python
# checks the time
    if ticks_diff(ticks_ms(), clock) &gt; weather_check:
        print("pinging Open-Meteo")
        # make the API request with function
        # return weather ID, temp, temp color &amp; hour
        weather, temp, temp_color, new_time = get_the_weather()
        # checks if it's day or night based on hour
        # &amp; returns day or night version of sprite
        img = day_or_night(new_time)
        label.text = "   %s°%s   " % (temp, temp_unit)
        # reset clock
        clock = ticks_add(clock, weather_check)
```

## Scroll the Weather

The core functionality of the display loops continuously. The sprite is drawn to the 5x5 grid and is shown for five seconds. Then, the temperature text is scrolled across the display. Once the text finishes scrolling, the process begins again by drawing the sprite.

```python
# draw bitmap sprite
    draw_sprite(count)
    # blocking delay to hold the sprite on the display
    time.sleep(5)
    # draw scrolling text
    for v in range(2):
        for i in range(text.width):
            # Scoot the old text left by 1 pixel
            pixels[:20] = pixels[5:]
            # adjust color based on temperature
            color = colorwheel(temp_color)
            # Draw in the next line of text
            for y in range(5):
                # Select black or color depending on the bitmap pixel
                pixels[20+y] = color * text[i,y]
            pixels.show()
            time.sleep(.1)
```

# NeoPixel Sprite Weather Display

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/117/161/medium800/projects_edited_P1390380.jpg?1671470412)

The weather display may be assembled with 3D printed parts, described below. The case has two parts: a cloud-shaped lid and a case to house the boards. Both parts print without supports.

The STL files can be downloaded directly here, from Thingiverse or from Printables.

[5x5WeatherDisplaySTLfiles.zip](https://cdn-learn.adafruit.com/assets/assets/000/117/160/original/5x5WeatherDisplaySTLfiles.zip?1671469321)
[Thingiverse download](https://www.thingiverse.com/thing:5727121)
[Printables download](https://www.printables.com/model/344403-neopixel-sprite-weather-display)
The main case has cutouts for the QT Py USB C port and the reset and boot buttons on the back. It has tiny holes to mount the QT Py header pins to keep the boards properly secured in the case.

![projects_edited_P1390376.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/162/medium640/projects_edited_P1390376.jpg?1671470420)

The cloud lid has an opening for the 5x5 NeoPixel Grid. It snap fits onto the main case.

![projects_edited_P1390359.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/163/medium640/projects_edited_P1390359.jpg?1671470431)

# NeoPixel Sprite Weather Display

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/117/164/medium800/projects_edited_P1390373.jpg?1671470456)

Solder socket headers to the 5x5 NeoPixel Grid BFF and solder plug headers to the QT Py ESP32-S2.

![projects_edited_P1390385.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/165/medium640/projects_edited_P1390385.jpg?1671470465)

Plug the QT Py ESP32-S2 into the NeoPixel Grid BFF. Make sure that the QT Py USB port is oriented properly by referencing the USB labeling and arrow on the back of the BFF.

![projects_edited_P1390388.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/166/medium640/projects_edited_P1390388.jpg?1671470531)

Insert the boards into the main case by lining up the QT Py header pins with the header pin slots in the bottom of the case.

![projects_edited_P1390393.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/167/medium640/projects_edited_P1390393.jpg?1671470541)

The boards should be situated in the center of the case with the QT Py USB port accessible via the side cutout.

![projects_edited_P1390399.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/168/medium640/projects_edited_P1390399.jpg?1671470599)

Close the case with the cloud lid. Make sure that the 5x5 NeoPixel Grid is centered in the cloud's cutout.&nbsp;

That completes the assembly!

![projects_edited_P1390405.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/169/medium640/projects_edited_P1390405.jpg?1671470633)

# NeoPixel Sprite Weather Display

## Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/117/172/medium800thumb/projects_29andSnowing.jpg?1671477953)

To use the weather display, plug the QT Py ESP32-S2 into a USB-C cable to power it. After connecting to your SSID / WiFi, the QT Py will make a request to the Open-Meteo API and display the current weather condition sprite and the current temperature.

As the incoming data changes from the API, the displayed sprite and temperature reading will update. Additionally, the sprite will change depending on the time of day as each sprite has a daytime and nighttime version.

## Update Your Latitude and Longitude
Open-Meteo uses latitude and longitude to pinpoint your location's weather. You can update these values to match your location at the top of the **code.py** file.

![projects_latLong.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/174/medium640/projects_latLong.jpg?1671479037)

You can use [Google Maps](https://www.google.com/maps/) to find the latitude and longitude of your location. Search your location and then **right-click on the map**. The latitude and longitude will appear in a pop-up window on the screen.

![projects_rightClickMaps.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/180/medium640/projects_rightClickMaps.jpg?1671562006)

## Customize the API Request
You can customize the Open-Meteo API request by changing the parameters in the URL. [Open-Meteo has documentation](https://open-meteo.com/en/docs) and a URL builder to track various pieces of weather data.

![projects_apiScreen.jpg](https://cdn-learn.adafruit.com/assets/assets/000/117/173/medium640/projects_apiScreen.jpg?1671478939)


## Featured Products

### Adafruit QT Py ESP32-S2 WiFi Dev Board with STEMMA QT

[Adafruit QT Py ESP32-S2 WiFi Dev Board with STEMMA QT](https://www.adafruit.com/product/5325)
What has your favorite Espressif WiFi microcontroller, comes with&nbsp;[our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C port, and has lots of Flash and RAM memory for your next IoT project? What will make your next IoT project flyyyyy? What a...

In Stock
[Buy Now](https://www.adafruit.com/product/5325)
[Related Guides to the Product](https://learn.adafruit.com/products/5325/guides)
### Adafruit 5x5 NeoPixel Grid BFF Add-On for QT Py and Xiao

[Adafruit 5x5 NeoPixel Grid BFF Add-On for QT Py and Xiao](https://www.adafruit.com/product/5646)
Our QT Py boards are a great way to make very small microcontroller projects that pack a ton of power - and now we have a way for you to quickly add a glittering grid of 25 RGB addressable&nbsp;micro NeoPixels. It's an excellent way to make tiny wearable, cosplay, or IoT projects with...

In Stock
[Buy Now](https://www.adafruit.com/product/5646)
[Related Guides to the Product](https://learn.adafruit.com/products/5646/guides)
### Break-away 0.1" 36-pin strip male header - Rainbow Combo 10 Pack

[Break-away 0.1" 36-pin strip male header - Rainbow Combo 10 Pack](https://www.adafruit.com/product/4154)
In this world, nothing can be said to be certain, except we need headers, headers, and&nbsp;_more headers_!

Each pack contains ten candy-colored&nbsp; **36-pin&nbsp;0.1" pitch break-away male headers.** &nbsp; These are a little extra special in that the plastic...

In Stock
[Buy Now](https://www.adafruit.com/product/4154)
[Related Guides to the Product](https://learn.adafruit.com/products/4154/guides)
### 20-pin 0.1" Female Headers - Rainbow Color Mix - 5 pack

[20-pin 0.1" Female Headers - Rainbow Color Mix - 5 pack](https://www.adafruit.com/product/4160)
Female header is like the duct tape of electronics. It's great for connecting things together, soldering to perf-boards, sockets for wires or break-away header, etc. We go through these real fast, and thought that given how handy they are, we'd offer them in a pack of five!

Each...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4160)
[Related Guides to the Product](https://learn.adafruit.com/products/4160/guides)
### Pink and Purple Woven USB A to USB C Cable - 1 meter long

[Pink and Purple Woven USB A to USB C Cable - 1 meter long](https://www.adafruit.com/product/5153)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;&nbsp;[If you want something just like it but for Micro B, we...](https://www.adafruit.com/product/4111)

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

## Related Guides

- [Adafruit QT Py ESP32-S2 and QT Py ESP32-S2 with uFL Antenna](https://learn.adafruit.com/adafruit-qt-py-esp32-s2.md)
- [Adafruit 5x5 NeoPixel Grid BFF](https://learn.adafruit.com/adafruit-5x5-neopixel-grid-bff.md)
- [Scrolling Countdown Timer](https://learn.adafruit.com/scrolling-countdown-timer.md)
- [No-Code IoT Soil Sensor](https://learn.adafruit.com/soil-node.md)
- [Two Way Telegraph with Analog Feedback Servos](https://learn.adafruit.com/two-way-display-with-analog-feedback-servos.md)
- [Traffic Light Conference Badge](https://learn.adafruit.com/traffic-light-conference-badge.md)
- [QT Py S2 Round Display Compass](https://learn.adafruit.com/qt-py-s2-round-display-compass.md)
- [IoT Moon Phase Guide](https://learn.adafruit.com/moon-phase.md)
- [Star Fragment IoT Lamp](https://learn.adafruit.com/star-fragment-iot-lamp.md)
- [Cartoon Character Clock](https://learn.adafruit.com/cartoon-character-clock.md)
- [NAU7802 Pet Food Scale](https://learn.adafruit.com/nau7802-pet-food-scale.md)
- [Wireless ESP32-S2 Touch Screen Controller for Pure Data](https://learn.adafruit.com/wireless-esp32-s2-controller-for-pure-data.md)
- [NeoPixel Novelty Cufflinks with Scrolling Text](https://learn.adafruit.com/neopixel-novelty-cufflinks-with-scrolling-text.md)
- [IoT Filament Sensor](https://learn.adafruit.com/iot-filament-sensor.md)
- [QT Py Snap Fit Case](https://learn.adafruit.com/qt-py-snap-fit-case.md)
- [CircuitPython Web Workflow Code Editor Quick Start](https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor.md)
- [Raspberry Pi Azure IoT Hub Dashboard with CircuitPython](https://learn.adafruit.com/raspberry-pi-iot-dashboard-with-azure-and-circuitpython.md)
