« »

Painting Pong

IMG_4590

For my networked pong game controller, I thought I’d have a go at using an accelerometer and a paint roller. Instinctively, everyone knows how to use a roller, so it seemed like a natural interface for a paddle that moves either up and down or left and right. I initially thought I was going to be using the accelerometer to measure movement. Turns out that accelerometers only measure movement with respect to gravity, which makes them kind of sucky for anything but determining orientation in space. Plan B was to use a photo sensor, an LED, and some black tape to make a rotary encoder.

IMG_4598

To get my encoder working, I counted the transitions from light to dark and dark to light and timed them, figuring that the longer of the two would represent the larger piece of tape and thus tell me which direction we were moving in. It sort of works.

The Arduino Code

I need to sit on this for a while. I'm sure there are plenty of documented ways of doing this (Tom Gerhardt used this method with his awesome spinning plates synthesizer) but I sort of want to figure it out on my own. I can easily get the orientation of the roller using the accelerometer but I might not be able to get the direction of its rolling using the method I'm using. Some sort of rotary switch attached along the actual axis of rotation would probably do the trick. I like the idea of doing it with light, though, so I'm going to keep on thinking about this, though I may give in to the Google soon.

IMG_4589

Comments

Comments are closed.