2021 Halloween Robot Costume

2,409
0
2021-10-28に共有
This is the costume I created for my company's Halloween event in 2021. Sorry for the crappy video quality.

This costume's interactive functions run on a Raspberry Pi Zero, and both the RPi and the LED buttons get their power from portable USB batteries. The RPi is connecting to a Bluetooth speaker for audio and is running a Python script that's about 275 lines. It probably doesn't need to be quite that long because there are functions I ended up abandoning and because I'm not very good at scripting.

The RPi boots up with the bottom-left switch, and I start the script from a very nice app I found called RaspController. You can use it to run custom commands, control GPIO, and all kinds of fun stuff. The script is just a while loop that pauses for a few milliseconds after each run, otherwise it eats all the CPU and causes issues. The Konami code functionality comes from a function attached to each button that either appends to a variable if one of the correct buttons is pressed, or resets the variable if it's not one of the correct buttons, interrupting the sequence. Once the correct sequence is entered, the Start button can be pressed and it checks the variable to see if it matches the correct pattern. If it does, it plays the warranty message (which I thought was funny), otherwise it plays the startup sound.

The bottom-right switch controls the LEDs for the buttons. They function with or without the lights on.

The three switches on the "form" accept either a yes, no, or neutral position. If any switch is neutral the three buttons below respond with "What's the precise nature of the problem?" If the switches are set, the buttons perform their other functions.

My coding is sub-par and the wiring is an absolute mess, but it does in fact work as I intended.

コメント (5)