HALLOWEEN SPRINT pt 5: Bugs and Other Nuisances #ElectronicHalloween

(Part 1, Part 2, Part 3, Part 4) This is likely the penultimate of these “Halloween Sprint” posts…if I do one more, it’s most likely just the finished costume, and then writing the “proper” Learn guide later. As mentioned in Part 4, I could have scrambled to finish for the weekend prior to Halloween, but took things easy. By luck this turned out for the better, because weird things popped up…

The wiring’s finished…just propped up with safety pins for now, I’ll sew in a pocket for it later. It’s a bit of a rat’s nest, partly because of an issue mentioned last time where I didn’t have a good body double to measure from, which had me wiring from the strips to the microcontroller board rather than the other way around…all the cable slack piles up in one place and looks bad (though it’ll be hidden under the cloak). Doesn’t affect functionality, it’s just ugly. That’s why I’m doing this shakedown build, so the tutorial version can be neater.

The weird part was finding a NeoPXL8 library bug that only came up because of this particular hardware/softwware combo…

I’d been wanting to test out a different WS2812-compatible LED strip type from a third party. Bought these a while back. It has “Eco” in the name, and I’d jumped to conclusions at the time that this must be a low-power thing. Nope! It’s short for “economical.” They’re addressable LEDs made of lower-cost materials…and with a lower lifespan to match…but for a Halloween costume seemed worth testing.

Every WS2812-compatible variant has slight signal timing differences, and I noticed these “Eco” strips would occasionally flicker with the Feather M0 I was originally testing with. On M0, M4 and ESP32, the NeoPXL8 code takes some liberties with WS2812 protocol timing to save on RAM. That’s worked fine with the NeoPixel strips we have in the shop, but was right on the edge for these weird eco strips. So I switched out for a Feather RP2040, as that version of the code is better able to approximate “traditional” WS2812 timing. Built everything around that…and wanting to keep things compact, didn’t even use sockets, just soldered headers directly from Feather to Wing, no going back…and then found that nothing would light at all!

The NeoPXL8 examples all worked fine on the exact same hardware, it was only the Ooze Master 3000 code that wouldn’t light. I’ll spare you the lengthy bug hunt story and just explain that NeoPXL8 on RP2040 doesn’t like dynamically declaring a NeoPL8 object like so:

NeoPXL8 *leds = new Adafruit_NeoPXL8(args);

It’s fine on the Feather M0, issue only manifests on RP2040. This never came up before because all the NeoPXL8 examples use static declarations:

NeoPXL8 leds(args);

The ooze code uses dynamic declaration because all the LED strips might be different lengths, and it makes a pass through a table to determine the longest one before allocating.

So the quick-and-dirty fix was to patch my own version of the code to use a static declaration, already knowing the fixed length of my longest strip. Solves the immediate problem, but a Good and Proper Fix will require finding the issue in the library. Also means that if anyone’s been following along to build something similar, and opted for the same Feather RP2040 instead of M0, you’d be at the same impasse. So it’s a good thing perhaps that the tutorial doesn’t need to be done this week.

Also added a NeoPixel flame effect to the eyes, and dressed up the scythe with some fairy lights. No good reason other than I just wanted more lights on things! More lights = more interest, and I hope someone will see all that on Halloween and be extra inspired to learn about electronics.

Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Join Adafruit on Mastodon

Adafruit is on Mastodon, join in! adafruit.com/mastodon

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 36,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org

Maker Business — “Packaging” chips in the US

Wearables — Enclosures help fight body humidity in costumes

Electronics — Transformers: More than meets the eye!

Python for Microcontrollers — Python on Microcontrollers Newsletter: Silicon Labs introduces CircuitPython support, and more! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

Adafruit IoT Monthly — Guardian Robot, Weather-wise Umbrella Stand, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — #NewProds 7/19/23 Feat. Adafruit Matrix Portal S3 CircuitPython Powered Internet Display!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !

No Comments

No comments yet.

Sorry, the comment form is closed at this time.