I am trying to hook up a servo and accelerometer to an arduino board so that the servo moves as the accelerometer's reading changes (read: pan/tilt mechanism).
The accelerometer outputs the correct data, until I begin to write the data to the servo. When I do this, the data coming from the accelerometer begins to jump around erratically, even when it is resting on a flat surface.
This is the line that is causing the problem:
As soon as I remove or comment out this line, it works normally.
Do any of you know what my problem is? Thanks.
(https://www.sparkfun.com/products/9652 this is the accelerometer I am using)