[RESOLVED] Accelerometer doesn't show correct info [RESOLVED]

Hey so I started playing around with arduino again and decided to play with an accelerometer sensor. So I plugged in all my jumper cables; (3v3 to 3v3) (gnd to gnd) (ST to A0) (Z to A1) (Yto A2) (X to A3) Then I loaded the example code → sensors/ ADXL3 the accelerometer code. I ran it and it uploaded fine but when I went into serial monitor the numbers just slowly run down tword 0. If I move the sensor it does not effect the values but they constantly run down to about 30 and stay around there. Did I do something wrong? Is there a way to see if my accelerometer isn’t broken? My baud is at 9600 like in the code as well.

Have a look at this:

http://www.electronicsblog.net/simple-angle-meter-using-adxl335-accelerometer-arduino/

and here:

Is it an analog accelerometer ?

The one I use is shown below.
The code example that worked with it:
http://bildr.org/2011/04/sensing-orientation-with-the-adxl335-arduino/

ADXL335.jpg

Ok so I have tried some different code and it still doesn't work. So i decided I would try to do some debugging, I unplugged all of the outputs. The xy and z from the accelerometer and ran the program. Silly enough the searial still puts out numbers and they constantly fluctuate in the tenths place. So I guess there must be something wrong here as there is no imput but the values continue to change.

The inputs are high impedance and probably floating.
Connect something like 1K resistors between each input and ground.

check the datasheet of the device.

Since it can detect ( or should be able to detect ) both +ve and -ve acceleration, the output when it detects zero acceleration should be Vcc/2.0 . Or about 1.6 volts. You should be able to detect this on the outputs with your multimeter.

Make sure it isn't a 5V device. You might not get good results putting only 3.3V into a 5V device ( but on the bright side, you won't fry it ).

It is 5v or 3.3 volt. The problem was that it was floating I hooked up a resistor to each connector and they all went down to 0. I used 100ohm, a 100k ohm, and a 4.7k ohm resistor but when I move the board the numbers don’t change from 0. I used three different ohms to make sure it just didn’t need a lower ohms. How I have rewired it is on my ground rail I have three resistors and the ground to accelerometer the resistors go to three different rails for my xyz and on these rails I have the connection from board to rail and from xyz to rail. I tried to make a diagram I doubt it is really any help with how confusing I made it… sorry. The values on it arent all the same but its the basic gist of what it looks like right now I think. Any help would be appreciated.

@tyscof

I suspect you misunderstood my previous post.
I only suggested the resistors to ground whilst the sensor was not connected in response to what you wrote:

I unplugged all of the outputs. The xy and z from the accelerometer and ran the program. Silly enough the searial still puts out numbers and they constantly fluctuate in the tenths place.

Ok so I finnally figured out what I was doing wrong! THere is a sleep pin and you have to set it to high, so i connected it with a resistor to 3.3 volt. Thanks for all the help