Playing with LEDs and Cameras
catch(e) " href="http://3.bp.blogspot.com/_XCDTVvEbBMU/SicStX9UIjI/AAAAAAAAAC4/SFayIykeD-o/s1600-h/nagasaki.png">
So a few weeks ago, my partner in crime and I were playing around with his homebrewed projector, a Wiimote, and a bunch of different software drivers for driving a mouse. Aaron did this little picture of a "happy little mushroom cloud" using MSPaint and a magic wand. A day or two later, I got some multipoint logic working on my MacBook Air's camera and a set of 2 LEDs scrounged out of Apple remotes. And have come to the conclusion that I must live in a cave.
One of the cool ones was an old TV remote for a TV which no longer serves any purpose other than taking up space on the floor, as the digital tuner is hooked up to one of the computers. It had this nice pad of surface mounted LEDs that would take some serious voltage. So I mashed a 9V up against some of the pads on the back of the PCB and lit them up on the camera.
catch(e) " href="http://4.bp.blogspot.com/_XCDTVvEbBMU/SicWuyp3ADI/AAAAAAAAADI/DOEFaIOsztM/s1600-h/SampleData.png">
This doesn't look like much but there are clearly visible 3 lights. What is so interesting about using a simple cutoff threshold is that it is terribly easy to compute. While the Wiimote hack is certainly a hell of a lot easier to use to do useful stuff, in a pinch you can use the built-in camera to do much the same thing. Using CoreImage filters and the Quicktime Capture routines make video capture an exercise in rather mindless programming. I've got maybe 20 lines of code in my entire demo app, and most of that is just wrapping Apple's classes and methods with nicer to use names. If the CPU/power draw wasn't so stupidly high I could see using it as a general input device.