Hi! I have written a simple code to read the raw accelerometer values from the ADXL 335 breakout board and I'm using Teensy 4.1.
The ccelerometer ADXL 335 breakout board is powered with 3.3 V and the axis pins connected to analog pins 13,14,15 on Teensy 4.1. I am getting spurios values like 3,6,10.
How can i get the correct ADC levels as the output? I've also tried changing to different analog pins and the same problem persists.
Code:
The ccelerometer ADXL 335 breakout board is powered with 3.3 V and the axis pins connected to analog pins 13,14,15 on Teensy 4.1. I am getting spurios values like 3,6,10.
How can i get the correct ADC levels as the output? I've also tried changing to different analog pins and the same problem persists.
Code:
Code:
int Xpin=13;
int Ypin=14;
int Zpin=15;
int xRaw, yRaw, zRaw;
void setup() {
Serial.begin(9600);
}
void loop()
{
xRaw=analogRead(Xpin);
yRaw=analogRead(Ypin);
zRaw=analogRead(Zpin);
Serial.print("X: ");
Serial.print(xRaw);
Serial.print(" Y: ");
Serial.print(yRaw);
Serial.print(" Z: ");
Serial.println(zRaw);
delay(1000);
}