Hi,
I'm a new user to Arduino IoT Cloud and so have little experience using it.
My aim is to send data from my IMU such as 3 axis acceleration and 3 axis angular velocity to the IoT cloud so that it can be displayed to a user on the dashboard in real time.
I am able to obtain the data I want from the IMU and stream it to the serial monitor and plotter, however I whenever I try to send this to the dashboard, it causes an error.
My hardware is a Adafruit BNO055 IMU and Seed Studio Xiao ESP32-C3.
Please see current code below, (I'm focusing on getting data in the x axis first before expanding to others)
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/90a9c6b7-46b0-4162-b40a-830ef68b9b51
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float acceleration_X;
float acceleration_Y;
float acceleration_Z;
float ang_Vel_X;
float ang_Vel_Y;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
#include <math.h>
#define BNO055_SAMPLERATE_DELAY_MS (100)
Adafruit_BNO055 myIMU = Adafruit_BNO055();
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
myIMU.begin();
delay(1000);
int8_t temp=myIMU.getTemp();
myIMU.setExtCrystalUse(true); //Use crystal on board not chip
}
void loop() {
ArduinoCloud.update();
uint8_t system, gyro, accel, mg =0;
myIMU.getCalibration(&system, &gyro, &accel, &mg);
imu::Vector<3> acc =myIMU.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);
acceleration_X = acc.x
Serial.println(acc.x()/9.8);
}
Here is the error message:
Any pointers on where I might be going wrong or helpful tips to try would be much appreciated.
Thanks!