Quick Propeller Project for DEF CON
JonnyMac
Posts: 9,102
Two days before our departure for DEF CON, my colleague Emlyne asks if I can help her hack a backpack with LEDs. We already had a mountain of things to do for work so I grabbed parts on hand: an EFX-TEK HC-8+ controller (I designed it), an Adafruit WS2812b LED ring, a button, and a 2" speaker with an inline cap (10uF).
The ring is animated and Em can change the display using the button. That was the useful bit of this project. I have a 1ms background loop that is used for scanning the 165s on the HC-8+. In this loop I added code to play beeps, boops, and monotonic music as well (this is code from an escape room project). Finally, I added a bit of code that could count button clicks. It took a bit of experimenting to get the time thresholds right, but it works nicely. Em is a HUGE Star Wars fan -- in fact, she just completed her own Stormtrooper armor and joined the 501st Garrison in LA. This is the reason or the Star Wars music in the bag.
Note: The HC-8+ uses 4427s to drive 5v outputs -- this is where I connect the speaker; it is not connected directly to an IO pin. The button is connected to one of the 165s.
Hopefully, someone will find something useful in this code. I couldn't do a DEF CON without some sort of Propeller project. Next year it will be P2.
The ring is animated and Em can change the display using the button. That was the useful bit of this project. I have a 1ms background loop that is used for scanning the 165s on the HC-8+. In this loop I added code to play beeps, boops, and monotonic music as well (this is code from an escape room project). Finally, I added a bit of code that could count button clicks. It took a bit of experimenting to get the time thresholds right, but it works nicely. Em is a HUGE Star Wars fan -- in fact, she just completed her own Stormtrooper armor and joined the 501st Garrison in LA. This is the reason or the Star Wars music in the bag.
Note: The HC-8+ uses 4427s to drive 5v outputs -- this is where I connect the speaker; it is not connected directly to an IO pin. The button is connected to one of the 165s.
Hopefully, someone will find something useful in this code. I couldn't do a DEF CON without some sort of Propeller project. Next year it will be P2.
Comments
Circle of lights is cool... I'll have to check that out on Adafruit...
I don't remember you ever having code for a single speaker like that on the Propeller, it's always been .wav files. And those new effects look cool, I'll have to try them out later - especially the War of the Worlds eye.
-Phil
Anything Star Wars is always a big hit and you have always been the master of "whipping stuff together".
I love that "Get in Loser" patch.
Thanks, Jeff. I've had that monotonic player code for a while -- I just never released it until now. SidCog may be a better way to go, but this is really simple for short, embedded strings of notes. I used this in several laser-tag accessories. The only real work for Em's backpack was the button click counting, and that wasn't more than an hour or so of coding and testing. Everything else was "art."
The "War of the Worlds" eye is simply the circle divided into three segments; this is a model inspired from the movie:
And here's my happy friend Em modeling our creation. Honestly, hand-sewing the patches on was the worst part.
I have decided to unleash my creative side and instead of simply assisting cosplayers, I am joining them. Em, our colleague Aaron, and I have all purchased tickets for Star Wars Celebration next year and I've committed to four costumes. To that end I just purchased a sewing/embroidery machine. While I am learning to sew and do foam fab I am also going to create a little cosplayer-friendly controller board for our costumes. Em already has a Stormtrooper. We're going to build one for Aaron (Death Trooper from Rogue One). I want our costumes to be the best in all aspects. I may make myself a little nuts, but I'm going to have fun learning new skills and strengthening my old ones.
Lord knows yours many posts and code over the years has bailed me out of many binds.
Sorry I missed you. I'm here with my new employer (cyber security company). I teach embedded design and coding to our IT staff. It's a really great group, run by another former Parallax employee, Ryan Clarke. Thank you for the kind words.
Great Job again,
Cheers...
This is the project iostreamh is referring to:
http://forums.parallax.com/discussion/170337/neopixel-party-glasses#latest
You seem to have an inexhaustible set of code trinkets in that big box of yours
I really admire your projects!
Really interested to see what you do for these Star Wars costumes. Even more so since you’re going to sew them too. It’s another handy skill to have. I’ve made sails for my boats many moons ago.
Thanks, Ray!
I finally got around to giving this a whirl now that Halloween's over. And I'm embarrassed to say that I can't get it to work!
Neopixels are connected to the Out7 TTL header - they don't light up at all. Older code that addresses them on that header works.
The speaker doesn't make a sound.
And no response from the button, no matter which of the In0 - In7 headers (R & W pins) I connect it to.
I have a Rev. E HC-8+, and I wonder if the eeprom is the difference here.
Jeff
The Rev F board does have TC-4427s on it which provide very stiff 5v output. The speaker should be connected through a 10-50uF series cap. The button is connected between IN0.R and IN0.W. I am running the code on a Rev F board without a speaker right now. Everything works (I can't hear the audio but I can see its activity on the OUT0 LED).
I've attached what I'm running right now.
First, change the PCB_REV in this section:
Then add this to the setup method:
That last bit comes from your older template for the HC-8+.