I’ve been playing airsoft and wanted a C4 prop (think like in CounterStrike). Saw some using Arduino Nano and LCDs, but thought it would be cool if it would also blow up if you shake it while armed… so I decided to make it out of a Proffie. I went and actually designed and 3D printed the whole thing.
It uses a 3 button setup, a 20px WS2812 strip, and a 128x64 SSD1306 OLED. I’ve also put a TP4056 module straight to the battery so I don’t have to disassemble the device for charging it, but never showing the actual Proffie USB and SD. But I digress.
The way I want it to work is the following way:
- Default state is turned off (a referee will physically power it up before each game).
- The Power button (is a latching one) acts to turns it on.
– Once it’s turned on, if you shake it, it might explode (this feature should stay in all modes save for Exploded Mode). - The red button is the Arm button. You have to keep it pressed for a certain time (default 20 seconds):
– The pixel display should advance as a progress bar until fully armed.
– The LCD should state “ARMING”, then “ARMED” and then start the timer. - This activate the Countdown mode:
– The timer counts down until it reaches zero and goes into Explode mode.
– The pixel should work as a percentage progress bar.
– A “ticking” sound should play.
– Once the countdown reaches 0, it goes into Exploded Mode. - Exploded Mode:
– It plays the “explode” sound.
– Mode stays in until power is recycled (to avoid tampering).
– Display shows “EXPLODED”. - Green button is the Defuse action. You have to keep it pressed for a certain time (default 20 seconds).
– The pixel display should advance as a progress bar until fully armed.
– The timer should still keep the countdown and the ticking sound.
– If the action takes longer than the countdown, it should still explode.
– If you defuse before the countdown reaches 0, it should go into Defused Mode. - Defused Mode:
– It plays the “defuse” sound.
– Mode stays in until power is recycled (to avoid tampering).
– Display shows “Defused”.
– You still need to release the PowerButton to be able to move it (optional).
Sorry for the lengthy explanation, but this post also works as a design document. I know it will take a while for me to implement this prop, but I have a couple of questions.
-
Is there a way to implement a global timer? Something that will keep ticking until reset? I’m not sure were to start, I guess I would create a timer object, use a
sleep()
function for ticks, add methodsfinish
,pause
andstop
andreset
? Then I should add something like anUpdateInterval
to update the countdown display and the blade state? -
I know this a non-standard OLED size, but I guess I should define my own fonts? It should be pretty similar to the BulletCount code?
-
If I want to change the “tick” pitch or tempo depending on the percentage of time left, I guess I should have
tickNN.wav
and change the pitch/length/volume progressively on aclash
?
Thanks for any help.