I love Halloween. I prefer it to Christmas these days, for lengthy reasons we won't go into here, but not least of them is the opportunity to scoop out the brains of an unwitting pumpkin.
In an effort to best last year's impressive effort (if I do say so myself)...
... I needed to up my game. Technology to the rescue!
So join me today in creating a Hack-O'-Lantern that stares right back at you (and into your very soul) thanks to the magic of CodeBug. Two CodeBugs, actually. Here's something to get you in the spirit before we begin.
Prep Ya Pumpkin
I'm not here to tell you how to hack a pumpkin into a Hack-O'-Lantern, but can't resist one or two quick tips.
I cut the hole in the top with the knife at an angle, so you get a clean cut but the "lid" doesn't fall back into the pumpkin when you replace it. And a notch somewhere in the lid makes sure it always locates in exactly the right position, so it doesn't look like you've had a machete in there and left Jack scalped. I also thin out the front wall, where you'll be cutting out the face, from the inside. Just makes it easier to add detail to Jack's features when you aren't sawing through 20mm of flesh.
It's also worth giving some thought to the eyes, and ensuring they're big enough to be able to see the CodeBugs' LED displays through them.
Don't Stare at Me, You Got the Bug Eyes
I went back and forth for a little with having two CodeBugs working in tandem. It was pretty effective having one triggered by the other, using the legs as inputs and outputs, but ultimately it was an unecessary complication. We'll get to that in a moment, though.
Firstly, I whipped up a couple of sprite animations for the CodeBugs, which will providing Jack's red, glowing pupils. They're pretty much identical to one another, except the eyeballs sometimes slant in the opposite direction, so two separate programs ensures they're a mirror image of each other. Both are attached to this doc, or you can check them out over on CodeBug.org.uk and remix your own.
As previously mentioned, triggering one from another ultimately wasn't necessary. Instead, I just wired the two Bugs in parallel, so they both activate at the same time.
In the image below, you can see that the two GND (ground) legs are connected together (black wire), with a flying lead that'll connect to the inside wall of the pumpkin. Leg 0 on both Bugs are also connected together, and have a longer flying lead that will connect to the lid of the pumpkin, so when you place the lid on top, the eye animations begin. Simple and classic.
To cover up the PCBs of the CodeBugs, I went with black tissue paper, although thin fabric would work just as nicely. So when it's not running, Jack's eyes look black, as below:
Make sure you get your spacing for the eye sockets correct, and tape (or sew) your CodeBugs into position behind the tissue paper (or your choice of masking material). I then folded the tissue paper up into something of an envelope, and added a few layers of tape to the top where it'll be hanging from (given that tissue paper is likely to tear).
Kinda rough and ready, but it'll do for a few days of Halloween scare tactics I also put a bit of insulation tape around the legs where they'll be up against the moist walls (oo-er) of the pumpkin, just in case. If they get damp, they'll conduct and the eyes will switch on whether the lid's in place or not, so this is just a simple way to prevent that.
Strip the ends of the two flying leads and wrap each one around a pin.
Stick one pin into the wall of the pumpkin (doesn't matter where, as long as it doesn't poke all the way through) and the other into the lid. Now, when the two pieces of pumpkin touch, the CodeBugs detect that Leg 0 has been grounded, and begins running the animation.
I also used pins to hang the tissue paper envelope containing the two CodeBugs behind the eyes.
Make sure the CodeBugs have their batteries inserted, put the lid on the Hack-O'-Lantern and watch him watching you!
Top Comments