I cannot get any reading from the imu using this code below. I can get reading from it from other boards but when i switched to the teensy 3.6 it now will not work any help is much appreciated
#include <Wire.h>
#include "SparkFun_BNO080_Arduino_Library.h"
BNO080 myIMU;
#define BNO_ADDRESS (0x4A) // device address when SA0 Pin 17 = GND; 0x4B SA0 Pin 17 = VDD
#define N_RST (24) // N_RST pin of BNO080
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("BNO080 Read Example");
Wire.begin();
myIMU.begin();
//Wire.setClock(400000); //Increase I2C data rate to 400kHz
//---------------------------------------------------------------
digitalWrite(N_RST, LOW); // Reset pulse active low
pinMode(N_RST, OUTPUT);
delay(100); // not clear how long this must be. reset probably not needed at all
digitalWrite(N_RST, HIGH);
//-------------------------------------------------------------------
myIMU.enableAccelerometer(50); //Send data update every 50ms
Serial.println(F("Accelerometer enabled"));
Serial.println(F("Output in form x, y, z, in m/s^2"));
//------------------------------------------------------------------------
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");
delay(200); //needed to accept feature command; minimum not tested
//--------------------------------------------------------------------------
}
void loop()
{
//Look for reports from the IMU
if (myIMU.dataAvailable() == true)
{
float x = myIMU.getAccelX();
float y = myIMU.getAccelY();
float z = myIMU.getAccelZ();
Serial.print(x, 2);
Serial.print(F(","));
Serial.print(y, 2);
Serial.print(F(","));
Serial.print(z, 2);
Serial.print(F(","));
Serial.println();
}
}
#include <Wire.h>
#include "SparkFun_BNO080_Arduino_Library.h"
BNO080 myIMU;
#define BNO_ADDRESS (0x4A) // device address when SA0 Pin 17 = GND; 0x4B SA0 Pin 17 = VDD
#define N_RST (24) // N_RST pin of BNO080
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("BNO080 Read Example");
Wire.begin();
myIMU.begin();
//Wire.setClock(400000); //Increase I2C data rate to 400kHz
//---------------------------------------------------------------
digitalWrite(N_RST, LOW); // Reset pulse active low
pinMode(N_RST, OUTPUT);
delay(100); // not clear how long this must be. reset probably not needed at all
digitalWrite(N_RST, HIGH);
//-------------------------------------------------------------------
myIMU.enableAccelerometer(50); //Send data update every 50ms
Serial.println(F("Accelerometer enabled"));
Serial.println(F("Output in form x, y, z, in m/s^2"));
//------------------------------------------------------------------------
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");
delay(200); //needed to accept feature command; minimum not tested
//--------------------------------------------------------------------------
}
void loop()
{
//Look for reports from the IMU
if (myIMU.dataAvailable() == true)
{
float x = myIMU.getAccelX();
float y = myIMU.getAccelY();
float z = myIMU.getAccelZ();
Serial.print(x, 2);
Serial.print(F(","));
Serial.print(y, 2);
Serial.print(F(","));
Serial.print(z, 2);
Serial.print(F(","));
Serial.println();
}
}