You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @pronenewbits
I want to use gyroscope and accelerometer sensors like lsm303dlh and l3gd20.
How to find the “entry point” to insert your own acceleration and angular velocity values into the code?
I get the raw data something like this:
#include <Wire.h>
#include <L3G.h>
#include <LSM303.h>
LSM303 mag_accel;
L3G gyro;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!gyro.init())
{
Serial.println("Failed to autodetect gyro type!");
while (1);
}
if (!mag_accel.init())
{
Serial.println("Failed to initialize mag_accel!");
while (1);
}
gyro.enableDefault();
mag_accel.enableDefault();
}
void loop() {
gyro.read();
mag_accel.read();
Serial.print(gyro.g.x);
Serial.print(",");
Serial.print(gyro.g.y);
Serial.print(",");
Serial.print(gyro.g.z);
Serial.print(",");
Serial.print(mag_accel.a.x);
Serial.print(",");
Serial.print(mag_accel.a.y);
Serial.print(",");
Serial.println(mag_accel.a.z);
}
The text was updated successfully, but these errors were encountered:
Hello @pronenewbits
I want to use gyroscope and accelerometer sensors like
lsm303dlh
andl3gd20
.How to find the “entry point” to insert your own acceleration and angular velocity values into the code?
I get the raw data something like this:
The text was updated successfully, but these errors were encountered: