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.


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.

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

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!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/

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


Maker Business — How (some) chips get made

Wearables — When it comes to wiring your neopixels, direction matters!

Electronics — Have the need for speed? This diode might be right for you

Python for Microcontrollers — Python on Microcontrollers Newsletter: 100 Blinka Compatible SBCs, RISC-V, and so much more! #CircuitPython @micropython @ThePSF @Raspberry_Pi

Adafruit IoT Monthly — Turtle Eggs, Pool Monitors, 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! — JP’s Product Pick of the Week 12/6/22 PCA9548 8-Channel I2C Multiplexer @adafruit @johnedgarpark #adafruit #newproductpick

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.