Shop OBEX P1 Docs P2 Docs Learn Events
Quick Propeller Project for DEF CON — Parallax Forums

Quick Propeller Project for DEF CON

JonnyMacJonnyMac Posts: 8,912
edited 2019-08-14 12:36 in Propeller 1
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.

ems_backpack.png

Comments

  • RaymanRayman Posts: 13,804
    My 6yo wants one for his birthday!
    Circle of lights is cool... I'll have to check that out on Adafruit...
  • Wow Jon, it's great to see a new project from you!

    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.
  • Once again, the Propeller and EFX-TEK shine as URAD (ultra-rapid application development) platforms. Congrats, Jon!

    -Phil
  • Jon,

    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.
  • JonnyMacJonnyMac Posts: 8,912
    edited 2019-08-11 02:26
    Jeff Haas wrote: »
    Wow Jon, it's great to see a new project from you!

    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.

    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:
    SJC_0588.jpg

    And here's my happy friend Em modeling our creation. Honestly, hand-sewing the patches on was the worst part.

    em_backpack.jpg
    640 x 800 - 362K
  • Once again, the Propeller and EFX-TEK shine as URAD (ultra-rapid application development) platforms. Congrats, Jon!

    -Phil

    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.
  • Well, nuts!!! My son and I just left Bally’s for the long drive home! Wish I’d have known you guys were there so I could buy you a beverage. Or two. :)

    Lord knows yours many posts and code over the years has bailed me out of many binds.
  • JonnyMacJonnyMac Posts: 8,912
    edited 2019-08-11 03:27
    JRoark wrote: »
    Well, nuts!!! My son and I just left Bally’s for the long drive home! Wish I’d have known you guys were there so I could buy you a beverage. Or two. :)

    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 Work JohnnyMac, You've inspired me to release my code for the Neopixel-Microphone Glasses I use; the project is in the project section of the forums. Its fun making things light up, especially when kids learn to code with them.

    Great Job again,

    Cheers...
  • iostreamh wrote: »
    Great Work JohnnyMac, You've inspired me to release my code for the Neopixel-Microphone Glasses I use; the project is in the project section of the forums. Its fun making things light up, especially when kids learn to code with them.

    Great Job again,

    Cheers...

    This is the project iostreamh is referring to:

    http://forums.parallax.com/discussion/170337/neopixel-party-glasses#latest
  • Cluso99Cluso99 Posts: 18,066
    Jon,
    You seem to have an inexhaustible set of code trinkets in that big box of yours :smiley:
    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.
  • Cluso99 wrote: »
    Jon,
    You seem to have an inexhaustible set of code trinkets in that big box of yours :smiley:
    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!
  • Jon,

    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
  • I don't know what's happening, Jeff. Em moved to New Jersey so I don't have access to the backpack anymore. That said, I don't see why the Rev E would make a difference.

    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.
  • Jeff HaasJeff Haas Posts: 416
    edited 2019-11-11 04:37
    Found it! This needs two changes to work on an HC-8+ with a rev. lower than "F":

    First, change the PCB_REV in this section:
    con
    
      ' Important!!! If you use this template with earlier PCBs, you MUST changes the revision constant
      ' before downloading.
    
      PCB_REV = "E"
    

    Then add this to the setup method:
    if (PCB_REV =< "E")                                            
        io.low(OUT_EN)                                              ' enable output driver
    

    That last bit comes from your older template for the HC-8+.
  • Darn, I forgot about that! Good catch.
Sign In or Register to comment.