• 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
SamBlenny Notes

SamBlenny

u/SamBlenny
Badges
17
9

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.

  • By SamBlenny

    Fruit Jam Color Checker

    This color checker is part of my quest to improve color matching from sprite editor apps to sprites displayed by CircuitPython. I wrote code to generate several color charts that explore how RGB332 and RGB565 colors on Fruit Jam's DVI output compare to the colors on a regular computer. 

    For previous projects, I've used sprite editor apps on iOS or Linux to prepare sprites for CircuitPython. In each of those cases, I've noticed color shifts, but so far I haven't fully understood what was going or how to correct it. This time, I want to do better.

    Transparency note: Adafruit provided the Fruit Jam rev B prototype board I used for this guide (Thanks Adafruit!).

    Overview

    8-bit color palette sampler test image
    Save
  • By SamBlenny

    Fruit Jam Gamepad Tester

    This is a visual gamepad tester for CircuitPython on Fruit Jam. The tester can detect and map buttons for several common gamepad types, including the Adafruit SNES-like gamepad. The tester can also display hexdumps of input event reports from HID boot-compatible keyboards and mice. Other HID devices may also work as long as their report lengths are short enough to fit on the screen (about 8 bytes).

    I wrote the code on CircuitPython 10.0.0-alpha.4 through 10.0.0-alpha.6 on a rev B Fruit Jam prototype. Using a Metro RP2350 with USB hub would probably work too. I haven't tried that, so it's possible you might need to make minor tweaks to the code for pin names (e.g. boot button and DVI out).

    To learn more about the spritesheet animation I use for the gamepad visualizer, check out my Feather TFT Gamepad Tester with Sprites guide from last year. This version of the tester for Fruit Jam is based on the Feather TFT version. For Fruit Jam, I added support for the larger display and more gamepad types. 

    Transparency note: Adafruit provided the Fruit Jam rev B prototype board I used for this guide (Thanks Adafruit!). Adafruit makes good stuff, please support them by buying from the Adafruit shop.

    Overview

    screenshot of DVI output from Fruit Jam Gamepad Tester
    Save
  • By SamBlenny

    I2C FRAM Memory Carts

    These removable non-volatile memory cartridges should work with the new Fruit Jam board and many other Adafruit microcontroller boards with I2C. The 3D printed shells hold a perma-proto PCB with a 4-pin magnetic connector and an I2C FRAM breakout board. To avoid I2C bus glitches, the base includes TCA4307 hot-swap I2C buffers and a PCA9546 4-channel I2C multiplexer. The multiplexer makes it possible to use two FRAM chips with the same I2C address at the same time.

    The CircuitPython code for this project is just a simple demo of writing to and reading from FRAM using the byte array interface provided by the adafruit-circuitpython-fram library. To use these memory cartridges for game save files, you would need to come up with a way to encode whatever data you want to store into a byte array of 32KB or less.

    Transparency note & shameless plug: Adafruit provided most of the parts I used for this guide (Thanks Adafruit!). Adafruit makes good stuff, please support them by buying from the Adafruit shop.

    Overview

    An assembly of boards and cables with two memory cartridges
    Save
  • By SamBlenny

    Zephyr Quest: IoT Toggle Switch for Feather TFT

    This guide shows how to make an IoT toggle switch with an Adafruit Feather TFT ESP32-S3, Zephyr, and Adafruit IO. Key features include: GPIO input for Boot button, LVGL graphics, MQTT over WiFi with TLSv1.2, and USB serial shell commands for saving WiFi and MQTT configuration settings to NVM flash. This guide is intended for people who want to learn how to write applications in C using Zephyr APIs.

    Demo video: IoT toggle switch: Zephyr + Feather TFT + Adafruit IO

    Previously in this series of guides about using Zephyr on Adafruit hardware, I focused on setting up developer tools and writing Devicetree board definitions. This time, I'm moving up the stack to show how to build an application tying together several Zephyr APIs along with a custom board definition.

    Building an IoT app with WiFi, TLS, and graphics is unavoidably a bit complicated. It took me about three weeks to write the code, which totals a bit over 2100 lines. Listing all of that here would be awkward. If you want the details, you can browse the code in my zphqst-03 GitHub repo. The code has lots of comments, including citations for the references I used while learning to use the Zephyr APIs.

    This guide will focus on:

    1. How to build, run, and configure the IoT toggle switch app
    2. High level tour of the source code with GitHub links: which files do what?
    3. Understanding C language features that you'll need to use Zephyr APIs effectively: structs, function pointers, etc.
    4. Zephyr troubleshooting tips: diagnose and fix memory allocation issues, enable various types of debug logging, etc.
    5. MQTT testing with openssl and the mosquitto MQTT broker with its companion command line tools, mosquitto_pub and mosquitto_sub
    Feather TFT displaying a toggle switch on its screen, in front of a computer monitor displaying an Adafruit IO dashboard
    Save
  • By SamBlenny

    Zephyr Quest: ST7789 Display with Feather RP2350

    As part of a series on Zephyr with Adafruit hardware, this guide shows how to configure Zephyr to use an ST7789 TFT display with a Feather RP2350. By connecting the display with a breadboard, we can use a logic analyzer to verify that the Zephyr display driver pin configuration agrees with the CircuitPython display driver. This guide is meant for people interested in adding support for Adafruit displays to Zephyr.

    Parts

    zephyr-display-sample-photo.jpeg
    Save
  • By SamBlenny

    Zephyr Quest: SWD Pogo Adapter for CLUE

    As part of a series on Zephyr with Adafruit hardware, this guide shows how I made a pogo pin SWD debug probe adapter for the CLUE board so I can conveniently program it with Zephyr firmware. My other SWD option was soldering wires to the test points, but I like how pogo pins are neater and less fragile. This guide is meant for people interested in adding support for Adafruit boards to Zephyr. It might also be useful for folks who want to fix a bricked bootloader.

    Overview

    base-with-perma-proto.jpeg
    Save
  • By SamBlenny

    Zephyr Quest: Feather RP2350 Board Def

    As part of a series on Zephyr with Adafruit hardware, this guide shows how to write a Zephyr board definition for the Adafruit Feather RP2350 with an I2C SHT41 temperature and humidity sensor. Future guides will look more at using sensors and displays. This is intended for developers who want to know about adding support for Adafruit boards to Zephyr. If you just want to write CircuitPython code, you can safely ignore this stuff.

    Overview

    Feather_RP2350_Pi_Debug_Probe.jpeg
    Save
  • By SamBlenny

    Zephyr Quest: Troubleshooting a Pi Pico2 build error

    As part of a series on Zephyr with Adafruit hardware, this guide documents the process I used to diagnose a problem with building Zephyr's hello_world sample app for Raspberry Pi Pico 2. By the time you read this, there's a good chance the Zephyr folks may have already fixed the problem that tripped me up. But, perhaps my troubleshooting process will be a useful reference.

    TLDR: Use west build ... -- -DCONFIG_PICOLIBC_USE_MODULE=y to build picolibc from source, or delete the ~/.cache/zephyr cache directory.

    The Linker Error

    Working towards the goal of writing a new board definition for the Adafruit Feather RP2350, I've been looking at how the device tree setup for the existing Raspberry Pi Pico 2 board definition works. When I got around to trying to build the hello world sample app for the Pico 2, which also uses the RP2350, I got stuck on a linker error.

    Below, I've included a console log which is a bit long. But, it shows some interesting details. The main error messages come in pairs that follow this pattern:

    • ...arm-zephyr-eabi/lib/./libc.a(strcmp.S.o): conflicting CPU architectures 17/2
    • ...ld: failed to merge target specific data of file ... /libc.a(strcmp.S.o)

    After the console log, I'll explain how I tracked this down and found a workaround.

    Save
  • By SamBlenny

    Getting Started with Zephyr on Linux

    This is for folks interested in learning about Zephyr. The first section shows, step by step, how to work through the Zephyr Getting Started Guide to install Zephyr on Linux, build the hello world sample, and run it on an Adafruit QT Py ESP32-S3. The second part has notes for tuning the default settings to use fewer resources for faster CI builds.

    What are Zephyr and West?

    The Zephyr Real Time Operating System (RTOS) provides an abstraction layer that helps make it easier to port applications like CircuitPython to boards from various manufacturers.

    In theory, using an RTOS makes it easier to implement features using audio synthesis, graphic displays, HTTPS, MQTT, BLE, etc. By building on top of Zephyr APIs, rather than vendor-specific SDK APIs, application code can ignore some of the differences between microcontroller families. Zephyr helps with low-level hardware details and coordinating CPU time for concurrent tasks including application logic, hardware IO, network stacks, and number crunching.

    Zephyr has a command line tool called west to manage and coordinate the many tasks involved in working on a Zephyr project. Once you install west, you can do west help to see documentation on the available sub-commands.

    zephyr-hello-world-3.jpeg
    Save
  • By SamBlenny

    Greenhouse Temperature Logger

    This guide shows how to build cheap data loggers to help keep plants happy in greenhouses or other indoor growing spaces. I developed this design to help a community garden group control temperatures in greenhouses for starting new plants in winter. By charting the temperatures, we were able to identify and fix problems with air sealing and heater thermostat settings. This logger design uses manual data collection over USB serial because there is no WiFi at the greenhouses.

    Wiring

    If you are unfamiliar with soldering stacking headers, you might want to read:

    • Adafruit Guide To Excellent Soldering

    • How To Solder Headers

    Fritzing Diagram

    This diagram shows the core circuit for the temperature logger, omitting the pin header and perma-proto stuff, and using a toggle switch to represent the jumper:

    greenhouse-logger-9.jpeg
    Save
  • By SamBlenny

    Zephyr Shell over USB or BLE + Bluefruit Connect

    Like Linux, Zephyr can route serial console streams to various hardware interfaces. This guide shows how to run the Zephyr Shell sample program on a QT Py ESP32-S3 using either USB serial or BLE with the Adafruit Bluefruit Connect app.

    Prerequisites

    To follow along with this guide, you will need:

    1. Linux computer running Debian 12, Ubuntu 22 LTS, Ubuntu 24 LTS, or similar
    2. Zephyr workspace including west and the Zephyr SDK's esp32-s3 toolchain (my Getting Started with Zephyr on Linux Playground guide explains how to set this up)
    3. Adafruit QT Py ESP32-S3 dev board (8flash/nopsram) with Zephyr bootloader (or you can use the ESP32 BOOT+RESET procedure to flash the Zephyr bootloader for the first time)
    4. iPhone with the Adafruit Bluefruit Connect iOS app.
    5_version_device_list.jpeg
    Save
  • By SamBlenny

    Calibrate Your 3D Printer for Dimensional Accuracy

    If you want to 3D print press-fit or snap-fit project enclosures, there are a few tricks you can use to get better dimensional accuracy. Unless you print in an extremely dry climate, it helps to dry your filament. You can also calibrate your printer's motion system, filament extrusion, and X-Y hole/contour compensation.

    Drying Your Filament

    FDM 3D printers work by melting plastic filament and carefully extruding it layer by layer to build up the desired shapes. Filament absorbs water from the air, and manufacturing filament involves a water cooling step. Wet filament can break more easily, and it can cause bubbles and stringing. Keeping your filament dry helps to get stronger prints with a smooth surface finish.

    How Dry is Dry Enough?

    People have lots of opinions about drying (for example, see r/3dprinting on reddit). For me, starting prints with filament stored in a plastic cereal box at 15% relative humidity has been working great. No bubbles. No splattering. Very little stringing.

    How To Dry Filament?

    For filament that's relatively dry to begin with, you just can put it in an air-tight plastic box with silica gel desiccant packs. In my experience, a plastic cereal box with about 50g of silica gel packets can take a roll of PLA filament from 25% to 15% relative humidity in less than a day. Starting at 15% out of the cereal box, if I print for a few hours in a room that's about 30% to 40% relative humidity, the hygrometer in my dry box usually reads 20% to 30% when I put the roll away. Within a few hours, that goes back down to 15%. But, it's important to note that silica gel can only absorb so much water before it needs replacement or drying, so this approach might not work well in humid conditions.

    For new filament, or filament that's been stored in anything other than crispy dry conditions, starting with a filament dryer may be quicker than relying on silica gel alone. Many makes and models of filament dryers are available, with new models introduced fairly often. To see what people currently recommend, you could check r/3dprinting on reddit.

    For new filament, I've been using a Sunlu FilaDryer S2 that I bought. The S2 works fine as long as I prop the lid open slightly (5mm to 8mm-ish gap). Typically, in 6 hours or less, the dryer will get a new roll of PLA filament down to about 25% relative humidity, but then it stops getting drier. From there, I put the roll in a cereal box with desiccant, wait a while, and it goes down to 15%.

    Upgrading Your Printer's Firmware

    Upgrading your printer's firmware to the latest available version may result in improved print quality compared to the factory firmware. How to go about a firmware upgrade will depend on what type of printer you have. For example, the Bambu Lab wiki has a page, Firmware update guide for P1 Series, that explains how to update the Bambu Lab P1S.

    Calibrating Tool Head and Print Bed Movement

    FDM printers use stepper motors with belts or drive screws to move the tool head and the print bed on 3 axes (X, Y, and Z). The stepper motors are controlled by the printer's firmware, which takes G-code instructions from a slicer (Bambu Studio, Cura, etc.). Calibration can help the motors move accurately, repeatably, and without problematic resonant vibrations.

    Typically, printers will provide some way to make sure the bed is level and to calibrate stepper motor motion. Calibrating the motion system can help to avoid problems with waves in the surface of printed parts. Bed leveling helps with good first layer adhesion, avoiding warping, spaghetti prints, and various other problems.

    How motion calibration and bed leveling works depends on what kind of printer you have. My printer is a Bambu Lab P1S, which I bought. The P1S uses a Core X-Y design with automatic bed leveling. Since bed leveling is taken care of automatically, I can pretty much ignore that part.

    For calibrating the motion system to avoid problems with vibration and belt tension, the P1S has a calibration feature available in the menu system on the printer's LCD control panel. I did that when I first set up the printer. It made a bunch of noise for a while, but was otherwise unremarkable.

    Calibrating Filament Extrusion

    To extrude the right volume of filament so that each line your printer lays down will merge smoothly into the previous lines, without gaps or bulges, you can calibrate the extrusion of your filament. Extrusion calibration is complicated. Terms people often use to talk about it include over extrusion, under extrusion, K factor, and pressure advance. Options for calibrating different aspects of the extrusion process vary according to the model of your printer and which slicer software you use.

    In the Bambu Studio slicer software, the Calibration tab offers two types of extrusion calibration, Flow Dynamics Calibration and Flow Rate Calibration. According to the Bambu Lab wiki, Flow Rate calibration is typically not necessary, so I ignored that one. But, the wiki recommends doing a Flow Dynamics calibration to set the K factor for new filament. I did a Flow Dynamics calibration for the filament I've been using (Bambu PLA Basic), and came up with a K factor of 0.02. I didn't notice much difference compared to the factory settings. The top surfaces of my prints seemed pretty smooth before and after the calibration.

    Calibrating X-Y Compensation

    In my experience, this is the really useful part for improving dimensional accuracy. Once you know that your filament is dry, your motion system is working well, and your extrusion flow is reasonable, it's time to check your X-Y hole and contour compensation. By printing a test block, measuring it, doing a little math, then setting the X-Y compensation values, I was able to improve my dimensional accuracy from about ± 0.12mm down to about ±0.5mm. That seems to be good enough for making press-fit bearing mounts without too much of wasted test prints.

    In Bambu Studio, under Prepare tab > left sidebar > Process heading, you can turn on the Advanced process settings option. When you do that, it enables input fields for "X-Y hole compensation" and "X-Y contour compensation" under Process heading > Quality tab > Precision sub-heading.

    To determine X-Y compensation values, you can print a test block, measure it with calipers, then do some simple math. Note that, similar to flow rate K factor calibration, your results here will likely be specific to the particular filament you're using and how dry it is.

    xycal-block-6_10mm-hole.jpeg
    Save
  • By SamBlenny

    Pumpkins vs Skeletons Game for CircuitPython

    This is a game about skeletons, pumpkins, and a catapult having a Spooky experience under the full moon. If you've thought about making a game in CircuitPython but aren't sure where to start, this project might be a useful source of ideas.

    Charging a Pumpkin

    This is how it looks when you hold the USB gamepad's A button to charge up a pumpkin.

    pumpkin-power.jpeg
    Save
  • By SamBlenny

    Feather TFT Clock with Gamepad Input

    This clock project uses USB gamepad input to control its time setting menu. The display uses TileGrid sprites that I made in Krita. The code demonstrates how to use timers and a state machine to build an event loop with gamepad input, I2C real time clock IO, and display updates.

    Overview and Context

    This clock is a step along the way on my quest towards learning how to build little games and apps in CircuitPython. The look for the display theme is about digital watches and alarm clocks from the 80's and 90's.

    Some of the technical bits and pieces from this project that you might be able to reuse in your own projects include:

    • Menu system for manually setting time and date

    • USB gamepad input system with edge-triggered button press events and repeating timer-triggered button hold events

    • Data-watch style display theme with three display areas: 20 ASCII characters at the top, an eight digit 7-segment clock display in the middle, and another 20 ASCII character display at the bottom

    • Main event loop with gamepad button polling, real time clock polling, state machine updates and display updates

    feather-tft-clock.jpeg
    Save
  • By SamBlenny

    Work in Progress: Feather TFT Clock

    This is an update on my current work in progress. I'm making a clock that will use gamepad buttons to set the time and date. The look is about 80's and 90's LED alarm clocks and digital watches. My larger goal is to explore making USB gamepad controlled GUIs in CircuitPython.

    For now, I'm deciding how I want time and date setting to work, including how the final sprites will look. To watch my video progress update, click through to the full post.

    Video Progress Update

    clock-in-progress.jpeg
    Save
  • First
  • Previous
  • 1
  • 2
  • 3
  • Next
  • Last
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
    "Fashion is what seems beautiful now but looks ugly later; art can be ugly at first but it becomes beautiful later"
    Unknown
    Adafruit Logo
    A Minority and Woman-owned Business Enterprise (M/WBE)