Arduino & Ruby code for an accelerometer-based controller