Lily Szajnberg and I built a high five tracker. Our assignment was to collect data from the ITP floor over a period of a few days. We decided that we should track awesomeness. So we asked that if anyone on the floor experiences a moment of Awesomeness (ie, mind blown in class, happy accidental code discovery, the LED finally blinks, etc.) then they were to log this awesomeness by high-fiving the tracker on the way down the hall.
The tracker consists of a framed picture of Michael Jackson with a simple switch connected to an Arduino that sends serial commands to a Processing sketch which takes a photo with a web cam, which is uploaded to this Flickr stream.
Interface
The interface consisted of a piece of 1/4″ framed plexiglass with an impatiently cut out picture of Michael Jackson with a giant sparkly glove taped to it. The frame and plexi combo are intended to make the interface durable enough to get punched in the face 100 times a day.
The frame is attached to a cable trough with velcro and a piece of card board. A joint in the cardboard allowed us to mount a simple switch which would bend on impact. The frame would then be allowed to swing freely until resting back in place.
Arduino
The switch is read by an Arduino Uno which is programmed to print serial data to the control computer. Here is the code;
Serial communication gets established and pins get assigned ports.
The switch is read and prints the state of the pin to serial as 0 or 1 (and also has a contingent in case nothing comes through).
There is a 4 second delay after the switch is tripped so the swinging frame can settle itself to avoid false positives.
Processing
Processing reads the incoming serial data which triggers the camera to shoot a frame. The photo loads to Flickr and its photo ID along with a timestamp and the date, logged as key value pairs into the ITP Cakemix database. We are then pulling the images back out using Javascript/JQuery as all data is saved as JSON. We could also easily use Ruby to pull out the data, but we want a live updating client side so as to avoid having to refresh the page to see new high-fiving (who can wait that long??).



