BNO055 Controlled Laser turret

Thread Starter

amachairas

Joined Mar 9, 2017
17
Hello everyone, i'm trying to build a pan/tilt turret with a laser mounted on it that is controlled by a bno055 mounted on eyeglasses. I have the sensor working but the problem is i want to mount it on the left temple changing the default orientation. When i try reading data this way, pan also affects tilt, as in they change together when i only change yaw. I have tried p0-p7 axis remap and none worked. Any suggestions ?


ESP32 Code:
  #include <Wire.h>
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BNO055.h>
    #include <utility/imumaths.h>
    
    
    /* This driver reads raw data from the BNO055
    
    
       Connections
       ===========
       Connect SCL to analog 5
       Connect SDA to analog 4
       Connect VDD to 3.3V DC
       Connect GROUND to common ground
    
    
       History
       =======
       2015/MAR/03  - First release (KTOWN)
    */
    
    
    /* Set the delay between fresh samples */
    #define BNO055_SAMPLERATE_DELAY_MS (100)
    
    
    
    Adafruit_BNO055 bno = Adafruit_BNO055(-1, 0x29, &Wire);
    
    
    
    void setup(void)
    {
      Serial.begin(115200);
    
    
      while (!Serial) delay(10);  // wait for serial port to open!
    
    
      Serial.println("Orientation Sensor Raw Data Test"); Serial.println("");
    
    
      /* Initialise the sensor */
      if(!bno.begin())
      {
        /* There was a problem detecting the BNO055 ... check your connections */
        Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
        while(1);
      }
    
    
      delay(1000);
    
    
    
    
      bno.setAxisRemap(Adafruit_BNO055::REMAP_CONFIG_P4);
      bno.setAxisSign(Adafruit_BNO055::REMAP_SIGN_P6);
    
    
      bno.setExtCrystalUse(true);
    
    
      Serial.println("Calibration status values: 0=uncalibrated, 3=fully calibrated");
    }
    
    
    
    void loop(void)
    {
     
      imu::Vector<3> euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);
    
    
      /* Display the floating point data */
      Serial.print("X: ");
      Serial.print(euler.x());
      Serial.print(" Y: ");
      Serial.print(euler.y());
      Serial.print(" Z: ");
      Serial.print(euler.z());
      Serial.print(" pan: ");
      Serial.print(euler.x());
      Serial.print(" tilt: ");
      Serial.print(euler.y());
      Serial.print("\t\t");
 

Attachments

Top