I have an ADXL330 accelerometer (XYZ) and an Arduino Diecimila board.... I downloaded the code that was on this site for this item but my values appear to be constant. I hooked it up just like shown on the site.... also messed with the delay taking it from the initial value of 1000 to 50 but I still get nothing but the following.....
1023 1022 1023
1022 1022 1023
1022 1022 1022
1023 1022 1023
Any Ideas ?????
The setup I followed means the ADXL is getting 5v which is above it's range of 1.8v to 3.6v. Could this be doing it ??
I am pathetic at electronics so whatever guidance you give, dummy it down a bunch. ;D Thanks for any help you can give !
HERE'S THE CODE:
int groundPin = 18; // analog input pin 4
int powerPin = 19; // analog input pin 5
int xpin = 3; // x-axis of the accelerometer
int ypin = 2; // y-axis
int zpin = 1; // z-axis (only on 3-axis models)
void setup()
{
Serial.begin(9600);
// Provide ground and power by using the analog inputs as normal
// digital pins. This makes it possible to directly connect the
// breakout board to the Arduino. If you use the normal 5V and
// GND pins on the Arduino, you can remove these lines.
pinMode(groundPin, OUTPUT);
pinMode(powerPin, OUTPUT);
digitalWrite(groundPin, LOW);
digitalWrite(powerPin, HIGH);
}
void loop()
{
Serial.print(analogRead(xpin));
Serial.print(" ");
Serial.print(analogRead(ypin));
Serial.print(" ");
Serial.print(analogRead(zpin));
Serial.println();
delay(1000);
}