kalle123
User
Hallo Kalle
Bin auch am Nachbau der Ruderweg Messung. Ich würde gerne auch noch die y und z Achse messen. Kannst Du hierzu bitte die Formel auch angeben?
Gruss
Gorbi
Gorbi, verstehe ich jetzt nicht.
Der Code wertet doch alle drei Achsen aus
Code:
adxl.readAccel(&x, &y, &z); // read the accelerometer values and store them in variables
xg = 0.00385 * (x - offsetX) / gainX; // 0.00385 to convert the raw data to Gs
yg = 0.00385 * (y - offsetY) / gainY; // offset and gain for calibration
zg = 0.00385 * (z - offsetZ) / gainZ;
calc = xg / sqrt ((sq(yg) + sq(zg))); //sensor orientation!
tilt = atan(calc) * 57.296;
angle = int(tilt) * -1; //sensor orientation!
Gruß KH