I'm trying to get a Teensy 3.2 to work with the Adafruit 9 DOF board that uses the same accel and gyro sensors as the Teensy Prop shield.
https://www.adafruit.com/product/3463
I try to follow the directions to calibrate the Accel but when I load the recommended calibration sketch Motion Cal receives no data when I open the port the Teensy 3.2 is connected to. The serial output is "config error FXOS8700" so basically it fails as soon as this function is called in the Calibraion code needed to run the Motion Cal software.
I'm using this recommended library: https://github.com/PaulStoffregen/NXPMotionSense
I'm using this recommended library: https://github.com/PaulStoffregen/NXPMotionSense
I'm trying to run the latest Madgwick Sensor Fusion code in the NXPMotionSense Library to get the most accurate compass readings possible with tilt calibration.
Should this code work with the Teensy 3.2 and Adafruit breakout with the same two gyro and compass sensors?
I was able to calibrate the compass using Adafruits instructions to load ther ARHS Calibrate USB code along with Pauls Motion Cal software and then add the offsets to their Madgwick code manually. It works but the compass readings are wrong, it shows like 3 0-360 degree revolutions for every 1 full 360 degree turn. I think their Madgwick code is not correct and that's why I'm perferring to use Teensy's Madgwick code instead.
Any help is apperciated!
https://www.adafruit.com/product/3463
I try to follow the directions to calibrate the Accel but when I load the recommended calibration sketch Motion Cal receives no data when I open the port the Teensy 3.2 is connected to. The serial output is "config error FXOS8700" so basically it fails as soon as this function is called in the Calibraion code needed to run the Motion Cal software.
I'm using this recommended library: https://github.com/PaulStoffregen/NXPMotionSense
Code:
bool NXPMotionSense::begin()
{
unsigned char buf[NXP_MOTION_CAL_SIZE];
uint8_t i;
uint16_t crc;
Wire.begin();
Wire.setClock(400000);
memset(accel_mag_raw, 0, sizeof(accel_mag_raw));
memset(gyro_raw, 0, sizeof(gyro_raw));
//Serial.println("init hardware");
while (!FXOS8700_begin()) {
Serial.println("config error FXOS8700");
delay(1000);
}
while (!FXAS21002_begin()) {
Serial.println("config error FXAS21002");
delay(1000);
}
while (!MPL3115_begin()) {
Serial.println("config error MPL3115");
delay(1000);
}
//Serial.println("init done");
for (i=0; i < NXP_MOTION_CAL_SIZE; i++) {
buf[i] = EEPROM.read(NXP_MOTION_CAL_EEADDR + i);
}
crc = 0xFFFF;
for (i=0; i < NXP_MOTION_CAL_SIZE; i++) {
crc = _crc16_update(crc, buf[i]);
}
if (crc == 0 && buf[0] == 117 && buf[1] == 84) {
memcpy(cal, buf+2, sizeof(cal));
} else {
memset(cal, 0, sizeof(cal));
cal[9] = 50.0f;
}
return true;
}
I'm using this recommended library: https://github.com/PaulStoffregen/NXPMotionSense
I'm trying to run the latest Madgwick Sensor Fusion code in the NXPMotionSense Library to get the most accurate compass readings possible with tilt calibration.
Should this code work with the Teensy 3.2 and Adafruit breakout with the same two gyro and compass sensors?
I was able to calibrate the compass using Adafruits instructions to load ther ARHS Calibrate USB code along with Pauls Motion Cal software and then add the offsets to their Madgwick code manually. It works but the compass readings are wrong, it shows like 3 0-360 degree revolutions for every 1 full 360 degree turn. I think their Madgwick code is not correct and that's why I'm perferring to use Teensy's Madgwick code instead.
Any help is apperciated!
Last edited: