BNO055

Post test messages here

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
hans1
 
Posts: 3
Joined: Sat Mar 05, 2016 11:33 am

BNO055

Post by hans1 »

I am using your BNO055 with the sketch restore_offsets and the arduino UNO.This is working fine.
My plan is to build an autopilot for my boat so I need to read the course in a variable. That is where I fail.
I create a float course and assign that to event.orientation.x. Serial.print(course) gives me 0 while writing to LCD
with lcd.print(event.orientation.x,0) gives correct number.
I sent part of the code.
Thank you very much for any respons.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BNO055

Post by adafruit_support_rick »

Please post your entire sketch, and please post the Serial Monitor output from the sketch

User avatar
hans1
 
Posts: 3
Joined: Sat Mar 05, 2016 11:33 am

Re: BNO055

Post by hans1 »

Thank you for your respons, I posted the complete sketch but I still have to find out how to include the monitor output as that is continuously going on.
I feel not too bright.
Attachments
restore_offsets-160306a.zip
(2.62 KiB) Downloaded 124 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BNO055

Post by adafruit_support_rick »

Un-check the Auto Scroll box in the lower left of the Serial Monitor window. Then run your sketch

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BNO055

Post by adafruit_support_rick »

I don't know how this statement compiles successfully. But it's wrong.

Code: Select all

     mv=(event.orientation.x,0);
You want to do this:

Code: Select all

    sensors_event_t event;
    bno.getEvent(&event);
    float mv;// Also tried double and int
    mv = event.orientation.x;
   /*  Display the floating point data */
    Serial.print("koers: ");
    // Serial.print((float)event.orientation.x,0);
     
   Serial.print(mv, 4);
 

User avatar
hans1
 
Posts: 3
Joined: Sat Mar 05, 2016 11:33 am

Re: BNO055

Post by hans1 »

It is allright now, thank you very much.
In case you are still interesred in the output, I sent it hereby.
Attachments
putty.log
(5.13 KiB) Downloaded 224 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BNO055

Post by adafruit_support_rick »

Great!

Locked
Please be positive and constructive with your questions and comments.

Return to “Test Message Forum (closed)”