kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.04k stars 471 forks source link

Scope of the function problem #171

Open shashwathsb1998 opened 7 years ago

shashwathsb1998 commented 7 years ago

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_MASTER' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

          ^

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_PINS_16_17' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

                            ^

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_PULLUP_EXT' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

                                            ^

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_RATE_400' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

                                                            ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'void loop()':

MPU9250_MS5637_AHRS_t3:521: error: 'MadgwickQuaternionUpdate' was not declared in this scope

 MadgwickQuaternionUpdate(-ax, ay, az, gx*PI/180.0f, -gy*PI/180.0f, -gz*PI/180.0f,  my,  -mx, mz);

                                                                                                ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'void MS5637PromRead(uint16_t*)':

MPU9250_MS5637_AHRS_t3:1219: error: 'I2C_NOSTOP' was not declared in this scope

       Wire.endTransmission(I2C_NOSTOP);        // Send the Tx buffer, but send a restart to keep connection alive

                            ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'uint32_t MS5637Read(uint8_t, uint8_t)':

MPU9250_MS5637_AHRS_t3:1233: error: 'I2C_NOSTOP' was not declared in this scope

     Wire.endTransmission(I2C_NOSTOP);        // Send the Tx buffer, but send a restart to keep connection alive

                          ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'uint8_t readByte(uint8_t, uint8_t)':

MPU9250_MS5637_AHRS_t3:1340: error: 'I2C_NOSTOP' was not declared in this scope

Wire.endTransmission(I2C_NOSTOP); // Send the Tx buffer, but send a restart to keep connection alive

                   ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'void readBytes(uint8_t, uint8_t, uint8_t, uint8_t*)':

MPU9250_MS5637_AHRS_t3:1352: error: 'I2C_NOSTOP' was not declared in this scope

Wire.endTransmission(I2C_NOSTOP); // Send the Tx buffer, but send a restart to keep connection alive

I dont know how to solve these errors.

Please do help me out

kriswiner commented 7 years ago

Are you using a Teensy? The i2c_t3.h wire library is for Teensy only.

On Fri, Aug 11, 2017 at 10:16 AM, shashwathsb1998 notifications@github.com wrote:

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_MASTER' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

      ^

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_PINS_16_17' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

                        ^

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_PULLUP_EXT' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

                                        ^

MPU9250_MS5637_AHRS_t3:312: error: 'I2C_RATE_400' was not declared in this scope

Wire.begin(I2C_MASTER, 0x00, I2C_PINS_16_17, I2C_PULLUP_EXT, I2C_RATE_400);

                                                        ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'void loop()':

MPU9250_MS5637_AHRS_t3:521: error: 'MadgwickQuaternionUpdate' was not declared in this scope

MadgwickQuaternionUpdate(-ax, ay, az, gxPI/180.0f, -gyPI/180.0f, -gz*PI/180.0f, my, -mx, mz);

                                                                                            ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'void MS5637PromRead(uint16_t*)':

MPU9250_MS5637_AHRS_t3:1219: error: 'I2C_NOSTOP' was not declared in this scope

   Wire.endTransmission(I2C_NOSTOP);        // Send the Tx buffer, but send a restart to keep connection alive

                        ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'uint32_t MS5637Read(uint8_t, uint8_t)':

MPU9250_MS5637_AHRS_t3:1233: error: 'I2C_NOSTOP' was not declared in this scope

 Wire.endTransmission(I2C_NOSTOP);        // Send the Tx buffer, but send a restart to keep connection alive

                      ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'uint8_t readByte(uint8_t, uint8_t)':

MPU9250_MS5637_AHRS_t3:1340: error: 'I2C_NOSTOP' was not declared in this scope

Wire.endTransmission(I2C_NOSTOP); // Send the Tx buffer, but send a restart to keep connection alive

               ^

D:\IDM Downloads\Compressed\MPU9250-master\MPU9250_MS5637_AHRS_t3\MPU9250_MS5637_AHRS_t3.ino: In function 'void readBytes(uint8_t, uint8_t, uint8_t, uint8_t*)':

MPU9250_MS5637_AHRS_t3:1352: error: 'I2C_NOSTOP' was not declared in this scope

Wire.endTransmission(I2C_NOSTOP); // Send the Tx buffer, but send a restart to keep connection alive

I dont know how to solve these errors.

Please do help me out

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/171, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qiaBtXNx8Buk3IptErVYULx5AXF9ks5sXIx5gaJpZM4O06mX .

shashwathsb1998 commented 7 years ago

No im using an arduino UNO . Any idea where i can get the code for arduino ? :(

kriswiner commented 7 years ago

Just change the wire calls for Wire.h

On Fri, Aug 11, 2017 at 10:23 AM, shashwathsb1998 notifications@github.com wrote:

No im using an arduino UNO . Any idea where i can get the code for arduino ? :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/171#issuecomment-321870996, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qn1Az684dpbXNygbrZaR2isknlbwks5sXI4FgaJpZM4O06mX .

shashwathsb1998 commented 7 years ago

Im kinda new at this. What do you mean ?

kriswiner commented 7 years ago

Ask at the Arduino forum...

On Fri, Aug 11, 2017 at 10:33 AM, shashwathsb1998 notifications@github.com wrote:

Im kinda new at this. What do you mean ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/171#issuecomment-321873433, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qmu1a1zxYD4RQzYumY6wJQWhhsCNks5sXJB9gaJpZM4O06mX .

anchals02 commented 6 years ago

@shashwathsb1998 Were you able to find any solution to this problem? I am facing the same issue with Arduino Nano board.

kriswiner commented 6 years ago

This sketch is specifically for the Teensy. Make sure you are using an appropriate sketch for the MCU you are using or change the sketch.

On Tue, Sep 11, 2018 at 3:01 AM anchals02 notifications@github.com wrote:

@shashwathsb1998 https://github.com/shashwathsb1998 Were you able to find any solution to this problem? I am facing the same issue with Arduino Nano board.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/171#issuecomment-420218436, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qitf4vqdXBOWsdwFela8RDiexOrtks5uZ4oHgaJpZM4O06mX .

kriswiner commented 6 years ago

If you are using an Arduino try this sketch:

https://github.com/kriswiner/ESP8285/blob/master/MPU9250/MPU9250_MS5637_BasicAHRS2_ESP8266.ino

On Tue, Sep 11, 2018 at 7:33 PM Tlera Corporation tleracorp@gmail.com wrote:

This sketch is specifically for the Teensy. Make sure you are using an appropriate sketch for the MCU you are using or change the sketch.

On Tue, Sep 11, 2018 at 3:01 AM anchals02 notifications@github.com wrote:

@shashwathsb1998 https://github.com/shashwathsb1998 Were you able to find any solution to this problem? I am facing the same issue with Arduino Nano board.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/171#issuecomment-420218436, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qitf4vqdXBOWsdwFela8RDiexOrtks5uZ4oHgaJpZM4O06mX .

pocolocos commented 6 years ago

Hi, i'm facing the same problem using a Teensy 3.5 in detail: MPU9250_BMP280_BasicAHRS:489: error: 'MadgwickQuaternionUpdate' was not declared in this scope MadgwickQuaternionUpdate(-ax, ay, az, gx*pi/180.0f, -gy*pi/180.0f, -gz*pi/180.0f, my, -mx, mz);

any ideas?

pocolocos commented 6 years ago

rehi,

just found the missing code here: https://github.com/kriswiner/MPU9250/blob/master/quaternionFilters.ino already working - great stuff!