Hi all,
So the while loop is executed when event.orientation.y is >= 50. However when that statement becomes false (event.orientation.y is <= 50), the while statement keeps running.
I'm a bit unsure exactly what event.orientation.y is as I'm working off an example sketch from adafruit for the BNO055 9DOF. It's not declared in the sketch, and I'm not sure if I need to declare it or how to declare it if that's what's needed for this to work. I just know that it's value is being updated correctly, so I'm unsure why I'm stuck in the while loop when it's value is less than 50. Any ideas?
Thanks!
bno055_COMPASSv4.ino (7.56 KB)
First, post code in code tags.
Second, you changed something in the code, f*cking up the layout. The indentation does not math the brackets anymore. Use Ctrl+t to fix it.
Third, the first line of the loop defines the variable event. But the first thing you do inside the while is to try to make another variable called event. So the code is all bogus....
I'm pretty sure if the expression isn't met anymore the while will stop. So, why do you think it does not stop?
And even more important, what are you trying to achieve... ?
Thanks much Septillion,
Didn't know about the ctrl +t now I'm doing it all the time!
So for anyone who happens upon this thread, I ended up moving sensors_event_t event; to the beginning of the sketch, which I believe (correct me if I'm wrong) means that it's now declared globally and now all is working just great.