Sparkfun BNO080 - Teensy 3.6 >> 4.0

Status
Not open for further replies.
Sorry I have not been following as much right now...

But the interrupt pin:
Code:
boolean BNO080::begin(uint8_t deviceAddress, TwoWire &wirePort, uint8_t intPin)
{
	_deviceAddress = deviceAddress; //If provided, store the I2C address from user
	_i2cPort = &wirePort;			//Grab which port the user wants us to use
	_int = intPin;					//Get the pin that the user wants to use for interrupts. By default, it's NULL and we'll not use it in dataAvailable() function.
My guess is that they have not properly setup in this case in the SPI case the do set the pin to input pullup...
pinMode(_int, INPUT_PULLUP);

My guess is that is what should be in this case as well.

However it should also test that pin is not 255:
Code:
	boolean begin(uint8_t deviceAddress = BNO080_DEFAULT_ADDRESS, TwoWire &wirePort = Wire, uint8_t intPin = 255); //By default use the default I2C addres, and use Wire port, and don't declare an INT pin
My guess is it might be used in either SPI or I2C mode as a way for the device to signal to tell you it has data ready...

But again I have not really read through their code enough to know if you can say please start to get me this data and let me know when it is ready and then api to get it now...

Sorry not much help here.

Hi. thanks!

Do you meant that the int wire is needed and it has been removed in the reworked code and that that might be creating the freezing?

I am getting it right ?
 
Ok - ran the motionTracker sketch again and saw the same thing after 15mins of running - then i ran my test sketch and its still running after 15mins with no issue. Has to be something with that application. Since I don't have a similar setup to yours I can't really debug further. Only the developer and really do that one - maybe he has seen that issue before.

One other thing - becareful with that shield you are using its designed for a 5v Arduino and the T4 is NOT 5v tolerate if for some reason the pot presents itself that way. The project does look interesting.

EDIT: just as an aside probably would have used a T4.1 and used the USBHost connections to attach a PS4 :) But that would require rewriting a bunch of the code which right at this moment I can't play with maybe in a day or 2.

The digipshield is connected to the teensy, from 3.3v of the teensy to the 5v of the digishield.

Regarding the ps4, would u be bale to bypass the softare limitations of the ps4 that blocks any other usb peripheral different than theirs to work on their console?

I am following the idea of the hardware hack , to avoid any software limitations imposed by steamvr (in case of vr use) or ps4/ps5 .

I am looking as next step the injection in steamvr of this arduino based project. For now for vr , I hacked a knuckles controller knuckles connections.jpg

I made the previous part of the project public on github

https://github.com/marcob2178/Arduino-Based-Game-Locomotion

The code you have been working on right now is not posted yet there.

Would love if you would become more and more interested in this and make the whole thing better.
My goal was/is to make an arduio based locomotion multisystem to use on most of devices.

I tested the previous code on:

xbox/pc/ps4/oculus quest/custom vive tracker controller/custom xinput controller
 
I agree @KurtE. Should be usable in both cases just never checked it out, that was one of the reasons I suggested adding pinMode(int pin, INPUT). But INPUT_PULLUP is probably better but in the modified sketch I removed the use of the int pin all together = unless its somewhere else in the code. So very tempted to rewrite the darn thing to use USBHost just to see what happens. :) Another distraction for after painting.

I think the int was used in the code I sent you and it had a purpose. Not sure what purpose, but maybe that is the reason why we get the error now ?
 
Just giving an update. We replaced the bno080 with the bno055 and mounted it on the 2nd bus and there is no freezing at all.

Was faster this way than figuring out a solution for the bno080,

Thank you so much!
 
Sorry for the delay in responding but been busy with a few other projects.

Was trying to figure out where the problem was but no luck. Probably best that you switch to the BNO055, as you said makes you life easier.
 
Sorry for the delay in responding but been busy with a few other projects.

Was trying to figure out where the problem was but no luck. Probably best that you switch to the BNO055, as you said makes you life easier.

No worries! Thank you so much for what you have done. Thank you to you and who else replied here :)
 
Hi @mjs513 , @PaulStoffregen , how are you? I have a question. It is not clear to me how the teensy handles the running of the code on boot.

To use my code, I upload the sketch to the teensy and then I open the monitor window and the locomotion system starts calibrating and then works on the controller. So I manually start the calibration and the run of the coding.

When I connect the teensy via usb to a usb power bank, the code and calibration does not start.

The arduino was handling automatically the starting of the code and calibration.

How can I have the teensy automatically starting the code and the calibration?

Also how can I restart the code and calibration on the teensy if I have to?

Thanks!
 
...

To use my code, I upload the sketch to the teensy and then I open the monitor window and the locomotion system starts calibrating and then works on the controller. So I manually start the calibration and the run of the coding.

When I connect the teensy via usb to a usb power bank, the code and calibration does not start.
...

Not seeing current code? perhaps there is some type of "while(!Serial);" in setup - or the indicated "manually start the calibration" is holding things up waiting for user input.

either way adding some variation of " ... && millis() < 5000 ) " with a wait time to allow manually starting or passing on timeout- where that would wait 5 seconds.
 
Not seeing current code? perhaps there is some type of "while(!Serial);" in setup - or the indicated "manually start the calibration" is holding things up waiting for user input.

either way adding some variation of " ... && millis() < 5000 ) " with a wait time to allow manually starting or passing on timeout- where that would wait 5 seconds.

Hi. Thanks for the reply.
This is the main file

http://www.mediafire.com/file/2gt7avyepddrmjd/Motion+tracker+on+Teensy.7z/file

Could you please suggest what to revise?

Thanks
 
just dropping the INO in the post would be easier - than pulling the zip and working through it just to see the setup() code and what it does
 
Found the download file it seemed clean - the PUP was prevented after download - doesn't seem that download site may be clean.

So looking in the non IDE source tree this is the problem - see post above #158 fpr the suggested solution:
Code:
void setup()
{
  Serial.begin(CUSTON_UART_SPEED);
[COLOR="#FF0000"][B]  while (!Serial)
    ;[/B][/COLOR]
  Serial.println("Started!");
 
Found the download file it seemed clean - the PUP was prevented after download - doesn't seem that download site may be clean.

So looking in the non IDE source tree this is the problem - see post above #158 fpr the suggested solution:
Code:
void setup()
{
  Serial.begin(CUSTON_UART_SPEED);
[COLOR="#FF0000"][B]  while (!Serial)
    ;[/B][/COLOR]
  Serial.println("Started!");

Thank you so much! Worked!

This is a video of a test of the locomotion system using the teensy

 
Schematic (16).jpg

I have a question about wireless connectivity and teensy.

What teensy I could use to make the system wireless and based on this amount of nodes as in the attached picture ?
 
Hi guys, I am back to the a same sort of issue.

I have a new bno080 that works on an arduino uno but not on a tensy 3.2 or teensy 4.0

This is the i2c scanning code I am using on the uno and teensy when the bno080 is connected to each

Code:
// Arduino I2C Scanner
// Re-writed by Arbi Abdul Jabbaar
// Using Arduino IDE 1.8.7
// Using GY-87 module for the target
// Tested on 10 September 2019
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.

#include <Wire.h> //include Wire.h library

void setup()
{
  Wire.begin(); // Wire communication begin
  Serial.begin(9600); // The baudrate of Serial monitor is set in 9600
  while (!Serial); // Waiting for Serial Monitor
  Serial.println("\nI2C Scanner");
}

void loop()
{
  byte error, address; //variable for error and I2C address
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for (address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address < 16)
        Serial.print("0");
      Serial.print(address, HEX);
      Serial.println("  !");
      nDevices++;
    }
    else if (error == 4)
    {
      Serial.print("Unknown error at address 0x");
      if (address < 16)
        Serial.print("0");
      Serial.println(address, HEX);
    }
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000); // wait 5 seconds for the next I2C scan
}

The scanner detects the bno080 connected to the uno, but the scanner does not detect the bno080 connected to the teensy 3.2 and the teensy 4.0

Is there a sort of issue with compatibility between the bno080 and the teensy due to i2c library issues ?

What library should i use for the teensy to have the bno080 work on it?
 
Hi guys, I am back to the a same sort of issue.

I have a new bno080 that works on an arduino uno but not on a tensy 3.2 or teensy 4.0

This is the i2c scanning code I am using on the uno and teensy when the bno080 is connected to each

Code:
// Arduino I2C Scanner
// Re-writed by Arbi Abdul Jabbaar
// Using Arduino IDE 1.8.7
// Using GY-87 module for the target
// Tested on 10 September 2019
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.

#include <Wire.h> //include Wire.h library

void setup()
{
  Wire.begin(); // Wire communication begin
  Serial.begin(9600); // The baudrate of Serial monitor is set in 9600
  while (!Serial); // Waiting for Serial Monitor
  Serial.println("\nI2C Scanner");
}

void loop()
{
  byte error, address; //variable for error and I2C address
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for (address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address < 16)
        Serial.print("0");
      Serial.print(address, HEX);
      Serial.println("  !");
      nDevices++;
    }
    else if (error == 4)
    {
      Serial.print("Unknown error at address 0x");
      if (address < 16)
        Serial.print("0");
      Serial.println(address, HEX);
    }
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000); // wait 5 seconds for the next I2C scan
}

The scanner detects the bno080 connected to the uno, but the scanner does not detect the bno080 connected to the teensy 3.2 and the teensy 4.0

Is there a sort of issue with compatibility between the bno080 and the teensy due to i2c library issues ?

What library should i use for the teensy to have the bno080 work on it?

The BNO080 works on the T4.0 definitely - we tested that as you can see by this thread. Would suggest that you use the scanner that is installed with with Teensyduino:

Code:
File -> Examaples -> (Examples for Teensy 4.0) Wire -> Scanner

As for what sketch to use - I have been using the one from Sparkfun
 
The BNO080 works on the T4.0 definitely - we tested that as you can see by this thread. Would suggest that you use the scanner that is installed with with Teensyduino:

Code:
File -> Examaples -> (Examples for Teensy 4.0) Wire -> Scanner

As for what sketch to use - I have been using the one from Sparkfun

What i2c library must be used on teensy for the bno080 ?
 
What i2c library must be used on teensy for the bno080 ?

The Wire library. No special library. When the you load the sketch, for the BNO080 it will include it automatically. In the example Scanner you will see at the top of the sketch
Code:
#include <Wire.h>
As long as you select one of the Teensy boards it will pull in the correct Wire library by using that include.
 
I ran File > Examples > Wire > Scanner on a Teensy 4.0 with Sparkfun BNO080 here. This is the result in the serial monitor.

screenshot.png

If you're not getting any devices found by the Scanner example, there's probably something wrong with your wiring or hardware. As you can see, BNO080 definitely does respond to the Scanner example.

Here is the hardware. Luckily BNO080 is one of the 6 devices I have on this big test board (I set the slide switches to put the other 5 onto Wire2 for this test), so I can just plug it in and quickly run the test.

bno080.jpg

For this test, I used Arduino 1.8.15 with Teensyduino 1.54. But earlier versions should work.
 
I ran File > Examples > Wire > Scanner on a Teensy 4.0 with Sparkfun BNO080 here. This is the result in the serial monitor.

View attachment 25266

If you're not getting any devices found by the Scanner example, there's probably something wrong with your wiring or hardware. As you can see, BNO080 definitely does respond to the Scanner example.

Here is the hardware. Luckily BNO080 is one of the 6 devices I have on this big test board (I set the slide switches to put the other 5 onto Wire2 for this test), so I can just plug it in and quickly run the test.

View attachment 25267

For this test, I used Arduino 1.8.15 with Teensyduino 1.54. But earlier versions should work.

I am trying to run this code View attachment GyroTest2.zip on the teensy 3.2 with a bno080 connected to it and a sparkfun radio module ( SparkFun Transceiver Breakout - nRF24L01+) connected to the teensy , but the bno080 becomes undetected.
(
Any thoughts why?
 
I am trying to run this code View attachment 25290 on the teensy 3.2 with a bno080 connected to it and a sparkfun radio module ( SparkFun Transceiver Breakout - nRF24L01+) connected to the teensy , but the bno080 becomes undetected.
(
Any thoughts why?

Hard to say, without seeing things like wiring.
When you say Undetected? Are you saying
Code:
if (myIMU.begin() == false)
  {
    Serial.println(F("BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing..."));
    while (1)
      ;
  }
That you are receiving this message?


Are you using this BNO080? https://www.sparkfun.com/products/14686
Are any of the solder jumpers set?
Are the Pull Up Resistors enabled on the board and/or are there external ones ?

If you use the Wire Scanner example sketch does it see it?
 
Hard to say, without seeing things like wiring.
When you say Undetected? Are you saying
Code:
if (myIMU.begin() == false)
  {
    Serial.println(F("BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing..."));
    while (1)
      ;
  }
That you are receiving this message?


Are you using this BNO080? https://www.sparkfun.com/products/14686
Are any of the solder jumpers set?
Are the Pull Up Resistors enabled on the board and/or are there external ones ?

If you use the Wire Scanner example sketch does it see it?

Data doesn't change when moving the bno080. The bno080 i2c is having issues. After I use the above code, if I do the i2c scanner, the bno080 is undetected.

Did anyone tested on teeensy the bno080 in conjunction with a sparkfun radio module , on a teensy?
scanner, the bno080 is not detected anymore

View attachment GyroTest.zip

View attachment GyroTest2.zip

The code labeled gyrotest, has no issue. Bno080 i2c works

If I use the code labelled gyrotest2, the bno080 i2c stops working
 
I just ran your sketch using the BNO080 that @KurtE reference from sparkfun (https://www.sparkfun.com/products/14686) it does recognize and returns quat data from the BNO80 with an issue.

Now I just tried running the sketch again after unplugging it and replugging it back into the computer and I did get a BNO080 not recognized - is this what you are referring to - you need to be more specific on whats happening. Simple solution is to just reload the sketch and it works but it does overwhelm the serial monitor which will require you to open and close the serial monitor. Why - data is streaming faster than the serial monitor can keep up.

Oh and just for the record your dx and dy will always be zero - you have a minor problem with when you are assigning the currentQuat to the prevQuat.
 
Here is what I am seeing as output once I move the prevQuat = currentQuat after you print the data:
Code:
currQuat--> 0.52, 0.29, 0.40, 0.70, 0.52
dx, dy: 17, 22

edit: I do not have a sparkfun nRF24L01+ module. Second your gyrotest2 case doesn't include what you doing with the nrf radio or what library you are using etc.
 
Here is what I am seeing as output once I move the prevQuat = currentQuat after you print the data:
Code:
currQuat--> 0.52, 0.29, 0.40, 0.70, 0.52
dx, dy: 17, 22

edit: I do not have a sparkfun nRF24L01+ module. Second your gyrotest2 case doesn't include what you doing with the nrf radio or what library you are using etc.

gyrotest works for me

gyrotest22 is not working at all. I get no data at all.

The project is about controlling an emulated mouse via the t32 + bno080

The receiver is a leoanrdo with radio on it.

We move the bno080, the mouse pointer moves on the pc.

I will ask the developer helping me out replying here. He is educated on the matter. Thanks for the reply and help
 
Status
Not open for further replies.
Back
Top