#### _46.ino ####
# setup ändern in:
##################
mpu.setAddr(MPU6050_ADDRESS_AD0_HIGH);
mpu.initialize();
if(mpu.testConnection()) {
Serial.println(F("MPU6050 ok (HIGH)"));
} else {
mpu.setAddr(MPU6050_ADDRESS_AD0_LOW);
mpu.initialize();
if(mpu.testConnection()) {
Serial.println(F("MPU6050 ok (LOW)"));
} else {
Serial.println(F("MPU6050 falied"));
}
}
if(config.useACC==1)
{
mpu.setClockSource(MPU6050_CLOCK_PLL_ZGYRO); // Set Clock to ZGyro
mpu.setFullScaleGyroRange(MPU6050_GYRO_FS); // Set Gyro Sensitivity to config.h
mpu.setFullScaleAccelRange(MPU6050_ACCEL_FS_2); //+- 2G
mpu.setDLPFMode(MPU6050_DLPF_BW); // Set Gyro Low Pass Filter to config.h
mpu.setRate(0); // 0=1kHz, 1=500Hz, 2=333Hz, 3=250Hz, 4=200Hz
mpu.setSleepEnabled(false);
}
else // USE DMP
{
mpu.dmpInitialize();
mpu.setDMPEnabled(true);
attachInterrupt(0, dmpDataReady, RISING);
Serial.println(F("Init DMP MPU6050 competely done ... :-)"));
resolutionDevider = 16.4; // Overwrite resolution Devider, for DMP Usage sensitivity is +-2000deg/s, unfortunately
mpu.setRate(0); // 0=1kHz, 1=500Hz, 2=333Hz, 3=250Hz, 4=200Hz
mpu.resetDMP();
}
##################
#### MPU6050.cpp ####
# funktion hinzufühgen
##################
void MPU6050::setAddr (uint8_t address) {
devAddr = address;
}
##################
#### MPU6050.h ####
##################
public:
MPU6050();
MPU6050(uint8_t address);
void initialize();
bool testConnection();
void setAddr(uint8_t source);
##################
#### SerialCom ####
## ausgabe hinzufühgen
##################
void gyroRecalibrate()
{
gyroOffsetCalibration();
Serial.println(F("recalibration: done"));
}
##################