I don't know about the 2x4 keypad, but here's my ADXL330 sketch. Wiring is simple.
http://arduino.cc/playground/Main/ADXL330