user73967: I have to use a BNO055 to get temperature/accelerometer/Euler/Gyroscope data into one Arduino board for a school project. I am very new to coding so I am not familiar with the commands. I have gotten my BNO055 to give me all the data individually but I am having problems getting them all compiled into one code file to upload. I have googled it but I keep getting links to upload them individually. Posted below is my latest attempt.

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>

Adafruit_BNO055 bno = Adafruit_BNO055(55);

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Orientation Sensor 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.setExtCrystalUse(true);
}

void loop(void)
{
  /* Get a new sensor event */
  sensors_event_t event;
  bno.getEvent(&event);

  /* Display the current temperature */
  int8_t temp = bno.getTemp();

  Serial.print("Current Temperature: ");
  Serial.print(temp);
  Serial.println(" Celsius");
  Serial.print("");
}

void loop(void)
{
  /* Get a new Sensor event */
  sensors_event_t event;
  bno.getEvent(&event);

  imu::Vector<3> gyroscope = bno.getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);

  /* Display the floating point data */
  Serial.print("X: ");
  Serial.print(gyroscope.x());
  Serial.print(" Y: ");
  Serial.print(gyroscope.y());
  Serial.print(" Z: ");
  Serial.print(gyroscope.z());
  Serial.println("");
  delay(100);
}

void loop(void)
{
  /* Get a new sensor event */
  sensors_event_t event;
  bno.getEvent(&event);

  imu::Vector<3> accelerometer = bno.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);

  /* Display the floating point data */
  Serial.print("X: ");
  Serial.print(accelerometer.x());
  Serial.print(" Y: ");
  Serial.print(accelerometer.y());
  Serial.print(" Z: ");
  Serial.print(accelerometer.z());
  Serial.println("");
  delay(100);
}

void loop(void)
{
  /* Get a new sensor event */
  sensors_event_t event;
  bno.getEvent(&event);

  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.println("");
  delay(100);
}





user10285: Does the code below work? I have no compiler at hand, so I can not test it.
If you have to explain what you have done, you'll get into trouble. I don't know your teacher, but ... ;-). Seriously, that was very basic stuff. Try to find some documentation, how to program with the Arduino IDE and learn the basics. A good startpoint is https://www.arduino.cc/en/Tutorial/HomePage .
Then go on with SENSORs and Vector Maths.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>

Adafruit_BNO055 bno = Adafruit_BNO055(55);

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Orientation Sensor 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.setExtCrystalUse(true);
}

void loop(void)
{
  /* Get a new sensor event */
  sensors_event_t event;
  bno.getEvent(&event);

  /* Display the current temperature */
  int8_t temp = bno.getTemp();

  Serial.print("Current Temperature: ");
  Serial.print(temp);
  Serial.println(" Celsius");
  Serial.print("");

  imu::Vector<3> gyroscope = bno.getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);

  /* Display the floating point data */
  Serial.print("X: ");
  Serial.print(gyroscope.x());
  Serial.print(" Y: ");
  Serial.print(gyroscope.y());
  Serial.print(" Z: ");
  Serial.print(gyroscope.z());
  Serial.println("");
  delay(100);

  imu::Vector<3> accelerometer = bno.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);

  /* Display the floating point data */
  Serial.print("X: ");
  Serial.print(accelerometer.x());
  Serial.print(" Y: ");
  Serial.print(accelerometer.y());
  Serial.print(" Z: ");
  Serial.print(accelerometer.z());
  Serial.println("");
  delay(100);

  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.println("");
  delay(100);
}


73967: <p>I have to use a BNO055 to get temperature/accelerometer/Euler/Gyroscope data into one Arduino board for a school project. I am very new to coding so I am not familiar with the commands. I have gotten my BNO055 to give me all the data individually but I am having problems getting them all compiled into one code file to upload. I have googled it but I keep getting links to upload them individually. Posted below is my latest attempt.</p>
<pre>
#include &lt;Wire.h&gt;
#include &lt;Adafruit_Sensor.h&gt;
#include &lt;Adafruit_BNO055.h&gt;
#include &lt;utility&#47;imumaths.h&gt;

Adafruit_BNO055 bno = Adafruit_BNO055(55);

void setup(void)
{
 &nbsp;<b>Serial</b>.begin(9600);
 &nbsp;<b>Serial</b>.println(&#34;Orientation Sensor Test&#34;); <b>Serial</b>.println(&#34;&#34;);

 &nbsp;&#47;* Initialise the sensor *&#47;
 &nbsp;if (!bno.begin())
 &nbsp;{
 &nbsp;&nbsp;&nbsp;&#47;* There was a problem detecting the BNO055 ... check your connections *&#47;
 &nbsp;&nbsp;&nbsp;<b>Serial</b>.print(&#34;Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!&#34;);
 &nbsp;&nbsp;&nbsp;while (1);
 &nbsp;}

 &nbsp;delay(1000);

 &nbsp;bno.setExtCrystalUse(true);
}

void loop(void)
{
 &nbsp;&#47;* Get a new sensor event *&#47;
 &nbsp;sensors_event_t event;
 &nbsp;bno.getEvent(&amp;event);

 &nbsp;&#47;* Display the current temperature *&#47;
 &nbsp;int8_t temp = bno.getTemp();

 &nbsp;<b>Serial</b>.print(&#34;Current Temperature: &#34;);
 &nbsp;<b>Serial</b>.print(temp);
 &nbsp;<b>Serial</b>.println(&#34; Celsius&#34;);
 &nbsp;<b>Serial</b>.print(&#34;&#34;);
}

void loop(void)
{
 &nbsp;&#47;* Get a new Sensor event *&#47;
 &nbsp;sensors_event_t event;
 &nbsp;bno.getEvent(&amp;event);

 &nbsp;imu::Vector&lt;3&gt; gyroscope = bno.getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);

 &nbsp;&#47;* Display the floating point data *&#47;
 &nbsp;<b>Serial</b>.print(&#34;X: &#34;);
 &nbsp;<b>Serial</b>.print(gyroscope.x());
 &nbsp;<b>Serial</b>.print(&#34; Y: &#34;);
 &nbsp;<b>Serial</b>.print(gyroscope.y());
 &nbsp;<b>Serial</b>.print(&#34; Z: &#34;);
 &nbsp;<b>Serial</b>.print(gyroscope.z());
 &nbsp;<b>Serial</b>.println(&#34;&#34;);
 &nbsp;delay(100);
}

void loop(void)
{
 &nbsp;&#47;* Get a new sensor event *&#47;
 &nbsp;sensors_event_t event;
 &nbsp;bno.getEvent(&amp;event);

 &nbsp;imu::Vector&lt;3&gt; accelerometer = bno.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);

 &nbsp;&#47;* Display the floating point data *&#47;
 &nbsp;<b>Serial</b>.print(&#34;X: &#34;);
 &nbsp;<b>Serial</b>.print(accelerometer.x());
 &nbsp;<b>Serial</b>.print(&#34; Y: &#34;);
 &nbsp;<b>Serial</b>.print(accelerometer.y());
 &nbsp;<b>Serial</b>.print(&#34; Z: &#34;);
 &nbsp;<b>Serial</b>.print(accelerometer.z());
 &nbsp;<b>Serial</b>.println(&#34;&#34;);
 &nbsp;delay(100);
}

void loop(void)
{
 &nbsp;&#47;* Get a new sensor event *&#47;
 &nbsp;sensors_event_t event;
 &nbsp;bno.getEvent(&amp;event);

 &nbsp;imu::Vector&lt;3&gt; euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);

 &nbsp;&#47;* Display the floating point data *&#47;
 &nbsp;<b>Serial</b>.print(&#34;X: &#34;);
 &nbsp;<b>Serial</b>.print(euler.x());
 &nbsp;<b>Serial</b>.print(&#34; Y: &#34;);
 &nbsp;<b>Serial</b>.print(euler.y());
 &nbsp;<b>Serial</b>.print(&#34; Z: &#34;);
 &nbsp;<b>Serial</b>.print(euler.z());
 &nbsp;<b>Serial</b>.println(&#34;&#34;);
 &nbsp;delay(100);
}



</pre>
 10285: <p>Does the code below work? I have no compiler at hand, so I can not test it.</p>
<p>If you have to explain what you have done, you'll get into trouble. I don't know your teacher, but ... ;-). Seriously, that was very basic stuff. Try to find some documentation, how to program with the Arduino IDE and learn the basics. A good startpoint is <a href="https://www.arduino.cc/en/Tutorial/HomePage" rel="nofollow noreferrer">https://www.arduino.cc/en/Tutorial/HomePage</a> .</p>
<p>Then go on with SENSORs and Vector Maths.</p>
<pre><code>#include &lt;Wire.h&gt;
#include &lt;Adafruit_Sensor.h&gt;
#include &lt;Adafruit_BNO055.h&gt;
#include &lt;utility/imumaths.h&gt;

Adafruit_BNO055 bno = Adafruit_BNO055(55);

void setup(void)
{
  Serial.begin(9600);
  Serial.println(&quot;Orientation Sensor Test&quot;); Serial.println(&quot;&quot;);

  /* Initialise the sensor */
  if (!bno.begin())
  {
    /* There was a problem detecting the BNO055 ... check your connections */
    Serial.print(&quot;Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!&quot;);
    while (1);
  }

  delay(1000);

  bno.setExtCrystalUse(true);
}

void loop(void)
{
  /* Get a new sensor event */
  sensors_event_t event;
  bno.getEvent(&amp;event);

  /* Display the current temperature */
  int8_t temp = bno.getTemp();

  Serial.print(&quot;Current Temperature: &quot;);
  Serial.print(temp);
  Serial.println(&quot; Celsius&quot;);
  Serial.print(&quot;&quot;);

  imu::Vector&lt;3&gt; gyroscope = bno.getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);

  /* Display the floating point data */
  Serial.print(&quot;X: &quot;);
  Serial.print(gyroscope.x());
  Serial.print(&quot; Y: &quot;);
  Serial.print(gyroscope.y());
  Serial.print(&quot; Z: &quot;);
  Serial.print(gyroscope.z());
  Serial.println(&quot;&quot;);
  delay(100);

  imu::Vector&lt;3&gt; accelerometer = bno.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);

  /* Display the floating point data */
  Serial.print(&quot;X: &quot;);
  Serial.print(accelerometer.x());
  Serial.print(&quot; Y: &quot;);
  Serial.print(accelerometer.y());
  Serial.print(&quot; Z: &quot;);
  Serial.print(accelerometer.z());
  Serial.println(&quot;&quot;);
  delay(100);

  imu::Vector&lt;3&gt; euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);

  /* Display the floating point data */
  Serial.print(&quot;X: &quot;);
  Serial.print(euler.x());
  Serial.print(&quot; Y: &quot;);
  Serial.print(euler.y());
  Serial.print(&quot; Z: &quot;);
  Serial.print(euler.z());
  Serial.println(&quot;&quot;);
  delay(100);
}
</code></pre>
