MPU9250_<TwoWire> issue

I am compiling a sketch that includes the first couple of lines of the program code:

/* Accelerometer sketch

  • Read an accelerometer and display acceleration in m/s/s

< #include "MPU9250.h"
#define IMU_ADDRESS 0x68
MPU9250 IMU(Wire, IMU_ADDRESS); // Declare the IMU object>

I am running into the following compile error -

error: no matching function for call to 'MPU9250_::MPU9250_(TwoWire&, int)'
** MPU9250 IMU(Wire, IMU_ADDRESS); // Declare the IMU object**

Apparently, the IMU function, with two input parameters is the issue and is not found in MPU9250.h.
I have tried adding multiple libraries with no success.

Any help is truly appreciated as I am new to using Arduino and do not want to be stopped in my tracks by a missing library or whatever else the issue may be.

So which other constructors are available there? Perhaps the library uses Wire by default?

Did you run any example program for the library? If so you would have known how to write working code.

R Your topic was MOVED to its current forum category as it is more suitable than the original

What made you think that is was an Introductory Tutorial ?

You are using the wrong MPU9250 library for that code. There are many.

I have tried adding multiple libraries with no success.

Best to have only one MPU9250 library around at any one time. Remove the ones that don't have the required function call.

1 Like

I am just starting to experiment with Arduino using the Elegoo toolkit which i assumed was just part of the tutorials.

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