First, I ghetto-rigged this miniature pan/tilt turret using two micro servos, cardboard, screws, and duct tape. I probably shouldn’t be using cardboard, but this is just a prototype.

Next, I connected my ADXL335 3-axis accelerometer’s X,Y,Z terminals to analog pins 1-3 on my arduino. I plugged ground into ground and power into the 3.3V source (5V is too high).

I serial.printed the readings while playing with the accelerometer to find out what the range of the readings were. This is what I got:

Min

Max

X

268

409

Y

263

402

Z

277

412

X was the result of tilting the accelerometer left and right.
Y was the result of tilting the accelerometer forward and back.
Z reflected the orientation of the accelerometer whether it was upright or upside down.

Now, the servos accept a digital value from 0 to 180 for a full 180 degree range.
So, how do get the arduino to convert accelerometer readings to servo outputs? Exactly the same way you derive the well-known Fahrenheit/Celsius conversion formula. In case you forgot: (skip if you already know it)

How to Derive the Fahrenheit to Celsius Conversion Formula

You need two anchor points for each Celsius and Fahrenheit. We’ll use the water freezing and boiling temperatures.