How to send imu data to IoT

hi, i just buy arduino nano IoT33. i would like to send data from its imu to arduino IoT cloud but my code dont work can you pleas make it to wokr?`#include <Arduino_LSM6DSOX.h>
#include "thingProperties.h"

#include <Arduino_LSM6DSOX.h>
#include "thingProperties.h"

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();

}

void loop() {
  ArduinoCloud.update();
  // Your code here 
  
    if (!IMU.begin()) {
    Serial.println("Failed to initialize IMU!");
    while (1);}
  
  if (IMU.accelerationAvailable()) {
    IMU.readAcceleration(a_x, a_y, a_z);
  
}}

so this is it can you some how make it work please

From GitHub - arduino-libraries/Arduino_LSM6DSOX,

Did you notice how the example code differs from the way you coded the device? Did you run the example code to determine if your device is producing info?

Have you confirmed your credentials and connection info works? I use MQTT.fx to test out the log in info.

thx

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.