Skip to content

IMU.begin() return always 0 on Arduno MKR1010. #30

@Nocentinia

Description

@Nocentinia

Hello,
after various updates this library no longer works.
as usual it's one scandal after another.
I try any other library and I read the data perfectly.
a solution? or do we remain abandoned by Arduino as always?
I leave the code (which is the one provided by the examples) just to add a little more garbage

/*
  MKR IMU Shield - Simple Euler Angles

  This example reads the euler angle values from the IMU
  on the MKR IMU shield and continuosly prints them to the 
  Serial Monitor.

  The circuit:
  - Arduino MKR board
  - Arduino MKR IMU Shield attached

  This example code is in the public domain.
*/

#include <MKRIMU.h>

void setup() {
  Serial.begin(9600);
  while (!Serial);

  if (!IMU.begin()) {
    Serial.println("Failed to initialize IMU!");

    while (1);
  }

  Serial.print("Euler Angles sample rate = ");
  Serial.print(IMU.eulerAnglesSampleRate());
  Serial.println(" Hz");
  Serial.println();
  Serial.println("Euler Angles in degrees");
  Serial.println("Heading\tRoll\tPitch");
}

void loop() {
  float heading, roll, pitch;

  if (IMU.eulerAnglesAvailable()) {
    IMU.readEulerAngles(heading, roll, pitch);

    Serial.print(heading);
    Serial.print('\t');
    Serial.print(roll);
    Serial.print('\t');
    Serial.println(pitch);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions