I have a MMA8462Q (Redbot acceleromoter) that I can not get a good read from. I have it wired up properly, its A5 to SCL and A4 to SDA, ground to ground and 5v to 5v. I get a reading from it using the sketch below but they never change.
I always get:
0.00
75.00
12.00
Not matter how much I shake that accelerometer it never changes. Thanks in advance
#include <Wire.h>
float test;
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial for output
}
void loop()
{
Wire.requestFrom(29, 3); // request 6 bytes from slave device #2
while(Wire.available()) // slave may send less than requested
{
test = Wire.read(); // receive a byte as character
Serial.println(test);
}
delay(500);
}