Software Engineer

my implementation of the big red button

· by jsnby · Read in about 2 min · (288 Words)
Computers

I saw the post from the guys over at Metricfire about Building the Bit Red Button. I thought I’d build something similar as a proof of concept. Here’s what I ended up with:

red button

I used the same red dome button from SparkFun. Inside the case is an Arduino Uno that I repurposed from an earlier project. My dome button came equipped with an LED instead of an incandescent bulb, so I was able to power everything directly from the USB cable. I used an enclosure from RadioShack to keep everything clean.

The sketch running on the Arduino simply waits for you to push the button. When it does, it writes a message via the serial interface. I have a python script running on my laptop that captures the message and can then do anything I want it to do like updating a value in a database, firing off an http request, etc.

The code is laughable at best (the arduino sketch will only work once - you have to unplug the usb cable and plug it back in or press the reset button on the board which isn’t possible when it’s inside the enclosure), so I won’t be posting it. If I improve it in the future, I may reconsider.

I don’t really have a practical application for this right now, but I had fun building it which is all that matters. I’m hoping that one day I’ll have build some sort of startup (or work at some sort of startup) and use it to launch the product or something like that. If I worked someplace that leveraged the cloud, I could imagine hooking it up to launch instances or as part of something like Netflix’s Chaos Monkey.