IBusBM + BNO055 problems...

atamanul
Posts: 3
Joined: Thu May 02, 2024 4:46 pm

IBusBM + BNO055 problems...

Postby atamanul » Tue May 07, 2024 2:18 pm

I use the BNO055 and IBusBM, IbusServo libraries.
Used separately, it works fine.
When I use them together....the code freezes or the board restarts... does anyone know how I can solve the problem...!!! why BNO055 messes up servo signals or why messes up I2C... Uart...!!!

Code: Select all

#include <IBusBM.h>
// ================================== IBus Servo =============================
IBusBM IBusServo;
HardwareSerial Serial_1(1);
// ================================== Compass
#include "BNO055_support.h"
#include <Wire.h>
//#define ADDRESS 0x28
struct bno055_t myBNO;
struct bno055_euler   Yau;
double Compass;
unsigned long lastTime  = 0;
// ================================== I2C
#define SDA_0  19  //
#define SCL_0  21  //

void setup()
{
  Serial.begin(115200);
  Wire.begin(SDA_0, SCL_0);
  BNO_Init(&myBNO); 
  bno055_set_operation_mode(OPERATION_MODE_NDOF);
  delay(500);

  IBusServo.begin(Serial_1);
  Serial_1.begin(115200, SERIAL_8N1, 4, 15);
  delay(500);
}
void loop()
{
  // ========================= Compas =================================
  if ((millis() - lastTime) >= 100) 
  {
    lastTime = millis();
    bno055_read_euler_hrp(&Yau);
    Compass = Yau.h / 16.00;  //Convert to degrees
  }
  Serial.print(" Ch 0 = ");
  Serial.print(IBusServo.readChannel(0));
  Serial.print(" Compass = ");
  Serial.println(Compass);
  
}

atamanul
Posts: 3
Joined: Thu May 02, 2024 4:46 pm

Re: IBusBM + BNO055 problems...

Postby atamanul » Wed May 29, 2024 9:02 am

Solved.
I read very carefully the explanations of the IBusBM library.

Who is online

Users browsing this forum: No registered users and 81 guests