• Skip to main content
  • Shop
  • Learn
  • Blog
  • Forums
  • IO
  • LIVE!
  • AdaBox
Adafruit Logo
0
  • Sign In | Create Account
  • Playground
  • Shop
  • Learn
  • Blog
  • Forums
  • IO
  • LIVE!
  • AdaBox
Sign In
0
Adafruit Logo
  • Learn Categories
    • 3D Printing
    • AdaBox
    • Adafruit Products
    • Arduino Compatibles
    • Breakout Boards
    • Circuit Playground
    • CircuitPython
    • CLUE
    • Community Support
    • Components
    • Crickit
    • Customer & Partner Projects
    • Development Boards
    • Educators
    • EL Wire/Tape/Panel
    • Feather
    • Gaming
    • Hacks
    • Internet of Things - IOT
    • LCDs & Displays
    • LEDs
    • Machine Learning
    • MakeCode
    • Maker Business
    • micro:bit
    • Microcontrollers
    • Programming
    • Raspberry Pi
    • Robotics & CNC
    • Sensors
    • STEMMA
    • Tools
    • Trellis
    • Wearables
    Explore, Groups to get your gears turning
    Explore
    Groups to get your gears turning
    Explore Groups
  • New Guides
  • Playground
danak Notes
Image for user danak

danak

u/danak
Badges
3
2

Getting Started

Adafruit Playground is a wonderful and safe place to share your interests with Adafruit's vibrant community of makers and doers. Have a cool project you are working on? Have a bit of code that you think others will find useful? Want to show off your electronics workbench? You have come to the right place.

The goal of Adafruit Playground is to make it as simple as possible to share your work. On the Adafruit Playground users can create Notes. A note is a single-page space where you can document your topic using Adafruit's easy-to-use editor. Notes are like Guides on the Adafruit Learning System but guides are high-fidelity content curated and maintained by Adafuit. Notes are whatever you want them to be. Have fun and be kind.

Click here to learn more about Adafruit Playground and how to get started.

  • Image for user danak
    By danak

    CircuitPython Functions to Pretty Up Strings

    Here's a short one...

    Sometimes I find myself wanting to pretty up a string. For example, a value might come in all in lower case letters and I want to capitalize the first letter or maybe go for capitalizing all first letters. Another use case is using variable names (conventionally all lower case) for captions.

    • 'this is my string'  ===>  'This is my string'
    • 'top values' ===> 'Top Values'

    Python has title() and capitalize() functions but these are not implemented in CircuitPython. 

    Also, strings may be in camel case that I want to fix - the Weather Powerup on AdafruitIO sends text data back this way:

    • 'mostlyClear' ===> 'Mostly Clear'

    When there is a limited set of data I've used if/elif/else statements or used look-up dictionaries, but in some cases the inputs may not be known. Also, who wants to write all of the repetitive code! 

    Since CircuitPython does include upper() and lower() functions we can build functions to do this. So with the help of CoPilot I drafted and now include these three functions in my code when I am doing anything with strings:

    In these sample functions I only apply to strings that are greater than three characters long as generally when I have short strings, I want them to keep the case (such as 'MPH'). But you can change this if you want it to make the change to all input strings. In the camel_to_title() function I also replace underscores with spaces, primarily for when I use variable names as captions.

    Hope you find this useful - and be sure to share any custom functions you can't live without.

     

    Save
  • Image for user danak
    By danak

    Avoid Burnout...

    of your SH1107 Featherwing OLED

    I built a temperature tracker which included an OLED Featherwing to display the temperatures. Very simple - just 4 lines of white text on a black background. Today I noticed that after just a few days I was starting to see dimming of some pixels that were constantly on. Looking over the product page I noticed a caution that OLEDs will start to dim if left on. Oops...

    TFT's use backlight LEDs, and typically there is a backlight pin which could be used to dim or even turn off. I learned, however, that OLEDs are individual organic LEDs, so there is no backlight pin. 

    Save
  • Image for user danak
    By danak

    Troubleshooting CircuitPython Programs - Beyond the Print Statement

    The print() function is your first debugging tool

    When creating a CircuitPython program a great way to follow program flow and to examine parameters and values is to use a print() statement sending the information to the REPL. This is simple, tried and true, and you can comment them out when no longer needed to turn them off. Many times this is the way to go. 

    Sometimes, however, you might have a lot of print statements and multiple function calls and all of the information flowing into the REPL becomes a bit hard to follow. 

    Making print() output easier to read

    At this point one strategy to make the print outputs easier to follow is to add divider lines, line feeds, special characters, etc. For example:

    Get creative and use different characters for divider lines (i.e. =, +, *). You can also combine characters such as:

    Save
  • Image for user danak
    By danak

    Hacking the adafruit_io Library

    Adafruit IO Adds a New Power-up: AirQuality

    Adafruit IO recently added a new Power‑Up for IO+ subscribers: Air Quality. It works much like the existing Weather Power‑Up, pulling data from either Open‑Meteo (global coverage) or AirNow (official US EPA data). Naturally, I wanted to integrate it into my projects — and assumed it would be as simple as calling a new helper function in the adafruit_io library.

    Except… that function didn’t exist yet.

    So, this became a perfect opportunity to walk through how to explore a CircuitPython library, understand how it works under the hood, and extend it safely when needed.

    Diving Into the Library

    What is a library really?

    When I first started with CircuitPython, libraries felt mysterious — .mpy files I couldn’t open, doing complex things I didn’t need to understand. Eventually I discovered the Python source bundles on the Libraries page, and everything clicked: these are just normal Python files, compiled for efficiency.

    Finding the AQI Function

    For this project, I opened adafruit_io.py and searched for functions beginning with receive_, since the Weather Power‑Up uses: receive_weather(). 

    I found functions for weather, time, random data, and more — but nothing for the new Air Quality Power‑Up. That meant the library hadn’t been updated yet.

    Time to roll up my sleeves.

    AQI Display
    Save
  • Image for user danak
    By danak

    Getting my Fruit Jam Clock to Speak

    The Idea

    The Fruit Jam, with its built‑in audio, Wi‑Fi, HSTX display, SD card, generous memory, and other little goodies, is a fantastic platform for mixing creativity with a bit of technical magic. Add CircuitPython to the mix and you’ve got a wonderfully flexible development environment.

    With one of my Fruit Jams, I built a display that shows an analog clock face, rotates through an album of photos of my grandkids as the background, and pulls weather data from Adafruit IO that I can scroll through using an IR remote.

    With the built‑in TLV320 DAC, I also wanted it to sound like a clock — a really big clock. I wrote functions to synthesize polyphonic tones that mimic the classic Westminster Quarters every fifteen minutes, and at the top of each hour it plays a WAV file of a single church‑bell toll, repeated once for each hour. It turned into a great little project that let me explore different elements of CircuitPython and many parts of the Fruit Jam board.

    It’s been running for months now and has become a charming addition to my office. And the best part is that I can keep extending it whenever a new idea strikes.

    I Discovered Copilot Audio Expression

    The other day, while playing with Copilot, I noticed a link to Labs at the top of the screen. Clicking through, I found Copilot Audio Expression, described as “an experimental tool designed for effortless audio creation using Copilot’s latest voice‑generation models.” You simply type a word or phrase, and it “speaks” it for you — then you can download the result as an MP3.

    A few quick prompts and some experimenting with the different settings sparked an idea: Why not make my Fruit Jam clock talk?

    Everything old is new again...

    Stringing together audio samples to form phrases is nothing new — people have been doing it for decades, long before digital audio. One of my earliest Learn Guide projects, the Titano Weather Station, used prerecorded samples as alarms (“time for bed”). But once you go beyond a handful of words, the challenge grows quickly. A talking clock or calendar needs nearly a hundred different clips: dates, day names, months, ordinals, and more. Gathering, recording, editing, and normalizing all of that becomes a real chore.

    That’s where this new AI tool shines. I can generate clean, consistent audio samples for every word or phrase I need in just a few minutes.

    So let’s build a Fruit Jam clock that can announce the time and date.

    Step by Step

    This article focuses specifically on adding the talking capability to my existing Fruit Jam clock project. The display, weather integration, IR remote navigation, and Westminster chimes are all already in place — and I can cover those in a future article if there’s interest. For now, we’ll walk through the audio‑generation workflow that makes the clock speak.

    The overall process breaks down into four main steps:

    1.     Generate all the required words and phrases using Copilot Audio Expression
    2.     Convert the MP3 files to WAV format using FFmpeg
    3.     Organize the files on the SD card and create logical CircuitPython lists
    4.     Write functions that assemble and play the spoken phrases

    Generating the samples

    For my project, I needed the Fruit Jam to be able to speak:

    • The time (hours, minutes, AM, PM, noon, midnight)
    • The date (day name, month name, ordinal date, year)
    • The quarter hours (“quarter past”, “half past”, “quarter til”)
    • And as a bonus: holidays, special days, and fun extras 

    Copilot Audio Expression made this surprisingly easy.

    Before we dive in, note that Copilot Audio Expression is part of Copilot AI Labs and is marked as experimental. It may change or disappear at any time. The site I used is: Copilot Audio Expression Website.

    Copilot Audio Expression Website

    Fruit Jam Clock
    Save
  • Image for user danak
    By danak

    Pico Data Logging

    Save
  • Image for user danak
    By danak

    Newxie Digital to Analog Thermometer

    A Newxie display is a modern take on the classic Nixie tube aesthetic. It is a 135 wide x 240 tall TFT display with double pins on the bottom for mechanical stability - see the product page link below. 

    What's a good use for a Newxie display? How about an analog thermometer - you know, the old-school type with a glass tube with red alcohol inside that rises as the temperature rises. Let's build it! 

    Original Idea

    I've been working of building a weather information center using a Fruit Jam and the AdafruitIO Weather Power-up. AdafruitIO provides over 300 hyper local weather data elements updated every 20 minutes. Using it is like drinking from a fire hose, and most boards can only handle a few data points due to memory constraints. The Fruit Jam changed all that - with a 640x480 display and tons of memory, I can now display pages and pages of weather data. 

    Once I had the horsepower to show more than just text, I started thinking about more expressive ways to visualize the data. I thought that a classic thermometer would be an ideal way to display temperature data. As an added bonus, by adding a narrow stripe inside the main body, I can show a second temperature, such as the "feels like" temperature. Here is how it came out:

    On page 1 of the Fruit Jam Weather Center (I'm up to 10 pages so far) it shows current weather data. The thermometer sits vertically along the right edge, with bold tick marks and a clean red column that rises with the temperature. It shows degrees Fahrenheit for the left scale, degrees Celsius on the right side, and freezing is marked in red.

    The graphic was built using rounded rectangles from the adafruit_display_shapes library for the outlines and indicators, lines from display_shapes for the tic marks, and bitmap_fonts for the numbers. When all was said and done, there ended up being a lot of display elements to create this seemingly simple graphic. 

    After all that work let's make it reusable...

    With a little effort I converted the text into a separate helper library. The first hurdle was that not all displays are as large as the Fruit Jam. The original was 440 px high but to be reusable it needs to be scalable. Likewise if it isn't going to be as tall I'd also want to be able to customize the min/max values. Ultimately the goal was to make most of the elements customizable. After several iterations I with AI's help, got it working well enough to try it on a different display. 

    I had a "multi-board" where I have a Feather RP2350 connected to a 240x320 display, an RTC module, a TLV320 DAC, etc., that I've been using to try things out. So, I added an SPA06-003 temperature breakout and added the thermometer graphic:

     

     

    Your browser does not support the video tag.
    Save
  • Image for user danak
    By danak

    PyBadge Timer Box

    PyBadge as a CircuitPython Learning Platform

    The PyBadge is one of the most feature‑packed ways to experiment and learn CircuitPython. With an integrated TFT display, eight buttons, five NeoPixels, a light and an acceleration sensor, audio with an on-board speaker and amplifier for an external speaker, LiPo charging, and multiple expansion ports including a FeatherWing socket, it’s practically a handheld programming lab. 

    Then last week JP had Adalogger FeatherWing with its built‑in RTC on as his product pick of the week the idea clicked: let’s turn the PyBadge into a portable, multi‑function timing tool!

    Components

    Assemble the parts

    Putting it all together is quite simple. The only soldering needed is attaching header pins to the AdaLogger. 

    • Solder header pins to the FeatherWing. Install the headers on the bottom of the board facing downward.
    • Insert the coin cell into the FeatherWing.
    • Attach the FeatherWing to the socket on the back of the PyBadge.
    • Plug in the speaker
    • Plug in the battery
    • Connect to USB and you are ready to roll!

    Install CircuitPython

    Now install CircuitPython on your PyBadge - follow the instructions in the Learn Guide: 

    Your browser does not support the video tag.
    Save
  • Image for user danak
    By danak

    Fruit Jam Meteorologist

    Hyper Local Up-To-Date Weather

     

    The Fruit Jam has taken CircuitPython coding to the very next level for me. Since the board 

    The Fruit Jam is more than just fun and games...

     

    Fruit Jam Display first page of weather reporting project.
    Save
  • Image for user danak
    By danak

    Fun with Fruit Jam Neopixels

    The adafruit_fruitjam library makes controlling the five neopixels on the board pretty easy...

    Start with the basics

    We begin by initializing the library and setting things up:

    [note these are code snippets only - not a complete project]

    From here you can use the standard neopixel "fill" and "show" to control the neopixels altogether. To refer to the neopixel object you reference them by 'jam.neopixels' (note the s on the end) followed by the command. For example, a classic red blink would simply be:

    Save
  • Image for user danak
    By danak

    Fruit Jam Remote Control & the Power of the Community

    Just got a Fruit Jam and have been learning a lot - so many cool components wrapped into a neat little package. 

    One of the goodies included is an IR receiver that is available as board.IR, so I thought it might be neat to send commands to the Fruit Jam with a remote control. This is a quick look receiving input from a remote control. But this article is also a lesson on the power of the Adafruit CircuitPython community. 

    First, the parts for the project:

    I used a couple of odd remotes I had laying around and in fact I have two remotes coded in. 

    The Fruit Jam Learn Guide doesn't address coding the IR receiver, but there are other guides for getting IR signals. I started with:

    Save
  • Image for user danak
    By danak

    GPS Tracker Coding in CircuitPython - Going Down the AI Rabbit Hole

    The Idea

    I've lately been dabbling with AI coding assistance and have been impressed with what it can do. So, I thought I'd do a whole project from scratch using several boards I have been meaning to do something with. I thought I'd also take you all on the journey and maybe you will find this useful. I will use this Playground article to document the process. I will go through the components and assembly, list the prompts I used with the AI tool to build the code, and share what value this new tool gives me. 

    The Build

    The project is a GPS tracker. In a nutshell a GPS module, an OLED display and an AdaLogger board. Here are the components I used:

    Design Choices

    I chose these components for simplicity. Choosing an AdaLogger for the microprocessor gives me an SD card to log the output and gives me one Neopixel, a separate LED I can use as an indicator and an extra input button with board.BUTTON. The OLED display, although small (128x32), can convey a lot of information if done well, plus it gives me three input buttons for controls. The GPS board just works well with little effort.  

    Assembly

    Since the Feather ecosystem is perfectly modular, assembly was simple:

    • Solder headers on to the microprocessor, GPS FeatherWing and the OLED FeatherWing
    • Solder the sockets on to the Feather Tripler
    • Prepare the AdaLogger by inserting a formatted SD card and attach the LiPo battery to the connector. 
    • Insert a coin cell into the GPS module
    • Plug the three boards into the Tripler - I used a couple of rubber bands and a small piece of foam on the bottom to hold it all together

    That's all there is to it! With that - we are (almost) ready to code.

    GPS Tracker
    Save
  • Image for user danak
    By danak

    Raspberry Pi Pico Dice Programmed with CircuitPython

    Some design notes:

    • The top of the cube (yellow, top facing down) has a bevel. This matches the:
    • LED top section (pink) bevel - this keeps the top from sliding through the outer cube.
    • The bottom layer of the bottom section (tan) is about 4mm thick. The switches are about 4mm tall, so they would be flush with the bottom, except in order to make one switch more prominent (the power switch) I carved out about 1mm so that switch protrudes about 1mm below the bottom.
    • There is a box just large enough to squeeze in the battery holder keeping it firmly in the place in the assembled cube.
    • On the outside of the battery holder box is a shallow half-box which supports the Pico vertically, with the USB facing downward. The box is about 5mm wider than the Pico itself so there is room for the wiring to extend bast the edge of the board connected to the GPIO pins. The wired Pico is hot-glued to the support plate to keep it firmly in place when connecting a USB cable.
    • There is also 4mm groove in the base to allow the Pico's USB port to sit only 1mm above the bottom so a cable can be plugged in the assembled cube for updating the code without having to disassemble the cube. 

    3D Case Design

    I used TinkerCad (https://www.tinkercad.com) for my 3D design work. The original thought was to make two halves - a top and bottom that overlap/slide together. but I ran into some difficulties with this design. Ultimately, I broke it down into 3 parts - an outer 70x70x85mm cube with a 50mm square "hole" through the middle. Then I made two 50mm cubes for the top and bottom that mate open end to open end and slide into center of the cube. The heights of each are one half the depth of the cube so when assembled the closed ends are flush with the top and bottom of the cube. The top has the 9 holes which just fit the 10mm LEDs. The bottom had places to support the Pico and battery back with cut-outs for the slide switches and the USB connector on the Pico.

    Here are what the three parts look like in TinkerCad:

    Your browser does not support the video tag.
    Save
Search

Getting Started

Adafruit Playground is a wonderful and safe place to share your interests with Adafruit's vibrant community of makers and doers. Have a cool project you are working on? Have a bit of code that you think others will find useful? Want to show off your electronics workbench? You have come to the right place.

The goal of Adafruit Playground is to make it as simple as possible to share your work. On the Adafruit Playground users can create Notes. A note is a single-page space where you can document your topic using Adafruit's easy-to-use editor. Notes are like Guides on the Adafruit Learning System but guides are high-fidelity content curated and maintained by Adafuit. Notes are whatever you want them to be. Have fun and be kind.

Click here to learn more about Adafruit Playground and how to get started.

    • Contact Us
    • Tech Support Forums
    • FAQs
    • Shipping & Returns
    • Freebies
    • Terms of Service
    • Privacy & Legal
    • Website Accessibility
    • LLMs.txt
    • About Us
    • Press
    • Educators
    • Distributors
    • Jobs
    • Gift Cards
    "People who are really serious about software should make their own hardware"
    Alan Kay
    Adafruit Logo
    A Minority and Woman-owned Business Enterprise (M/WBE)