* moved files and added NXP fusion * rename and make unique names * renamed files and made a multi-filter tester * USB and Mahony examples are now superceded by one calibrated_orientation example * add lsm9ds0 fusion demo to calibrated_orientation and removed standalone version also moving really old 10dof/9dof demos * make one unified calibrator * add CI * add some deps * add more deps * more deps * update naming * more deps * skip and dep * manually add conversion const * more fixfix * change default to mahony * fix skips * clangclang * moreclang
20 lines
491 B
C
20 lines
491 B
C
#include <Adafruit_LSM9DS1.h>
|
|
Adafruit_LSM9DS1 lsm9ds1 = Adafruit_LSM9DS1();
|
|
|
|
bool init_sensors(void) {
|
|
if (!lsm9ds1.begin()) {
|
|
return false;
|
|
}
|
|
accelerometer = &lsm9ds1.getAccel();
|
|
gyroscope = &lsm9ds1.getGyro();
|
|
magnetometer = &lsm9ds1.getMag();
|
|
|
|
return true;
|
|
}
|
|
|
|
void setup_sensors(void) {
|
|
// set lowest range
|
|
lsm9ds1.setupAccel(lsm9ds1.LSM9DS1_ACCELRANGE_2G);
|
|
lsm9ds1.setupMag(lsm9ds1.LSM9DS1_MAGGAIN_4GAUSS);
|
|
lsm9ds1.setupGyro(lsm9ds1.LSM9DS1_GYROSCALE_245DPS);
|
|
}
|