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);
leds->begin();

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);
leds.begin();

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.


Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

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

Join over 38,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


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

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

Adafruit IoT Monthly — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

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.