too few arguments to function 'uint8_t mpu_get_compass_reg(short int*, long unsi

short mag[3];
magSampled = mpu_get_compass_reg(mag);

if (magSampled == 0)
{

if (outputUI) {
reportRawMag(mag);
}

float ox = (float)mag[0]/MAG_SCALEFACTOR - magOffset[0] ;
float oy = (float)mag[1]/MAG_SCALEFACTOR - magOffset[1] ;
float oz = (float)mag[2]/MAG_SCALEFACTOR - magOffset[2] ;

float rx = ox * magXform[0] + oy * magXform[1] + oz * magXform[2];
float ry = ox * magXform[3] + oy * magXform[4] + oz * magXform[5];
float rz = ox * magXform[6] + oy * magXform[7] + oz * magXform[8];

// pitch/roll adjusted mag heading
rawMagHeading = wrap(atan2(-(rz * sin(newv[PITCH]) - ry * cos(newv[PITCH])),
rx * cos(newv[ROLL]) +
ry * sin(-newv[ROLL]) * sin(newv[PITCH]) +
rz * sin(-newv[ROLL]) * cos(newv[PITCH])) * -10430.06);

magHeading = rawMagHeading;

if (calibrated)
magHeading = magHeading - compass[3];

if (offsetMag)
magHeading = magHeading + 32768.0;

magHeading = wrap(magHeading);

// Auto Gyro Calibration
if (startup)
{
blink();
parseInput();

if (startupPhase == 0)
{
for (int n = 0; n < 3; n++)
gBias[n] = avgGyro[n] = 0;

mpu_set_gyro_bias_reg(gBias);
startupPhase = 1;
startupSamples = 500;
return;

Do you have a question or were you just letting us know what hurdle you surmounted?

Please post complete code. Please post it between
** **[code]** **
and
** **[/code]** **

The error is clear, the function requires at least one more argument; I do not know what that argument is supposed to reflect.

Please post the full error message; it's truncated in the title so the function might even require a third argument.

im only allowed to use 9000 characters so i cant post it ill attach the code

:0:23: warning: ISO C++11 requires whitespace after the macro name
C:\Users\mvvgr\OneDrive\Documents\Arduino\EDTracker2_9250\EDTracker2_9250.ino:52:17: note: #pragma message: Sketch is EDTracker2_9250...
#pragma message "Sketch is EDTracker2_9250..."
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\mvvgr\OneDrive\Documents\Arduino\EDTracker2_9250\EDTracker2_9250.ino: In function 'void loop()':
EDTracker2_9250:296:42: error: too few arguments to function 'uint8_t mpu_get_compass_reg(short int*, long unsigned int*)'
magSampled = mpu_get_compass_reg(mag);
^
In file included from C:\Users\mvvgr\OneDrive\Documents\Arduino\EDTracker2_9250\EDTracker2_9250.ino:77:0:
C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\InvensenseMotionDriver/inv_mpu.h:117:9: note: declared here
uint8_t mpu_get_compass_reg(short data, unsigned long timestamp);
^~~~~~~~~~~~~~~~~~~
EDTracker2_9250:518:38: error: too few arguments to function 'uint8_t mpu_get_temperature(long int
, long unsigned int
)'
mpu_get_temperature (&tempNow);
^
In file included from C:\Users\mvvgr\OneDrive\Documents\Arduino\EDTracker2_9250\EDTracker2_9250.ino:77:0:
C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\InvensenseMotionDriver/inv_mpu.h:118:9: note: declared here
uint8_t mpu_get_temperature(long data, unsigned long timestamp);
^~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "EEPROM.h"
Used: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\EEPROM
Not used: C:\Program Files (x86)\Arduino\hardware\edtracker\avr\libraries\EEPROM
Multiple libraries were found for "Wire.h"
Used: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\Wire
Not used: C:\Program Files (x86)\Arduino\hardware\edtracker\avr\libraries\Wire
Multiple libraries were found for "I2Cdev.h"
Used: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\I2Cdev
Not used: C:\Program Files (x86)\Arduino\hardware\edtracker\avr\libraries\I2Cdev
Multiple libraries were found for "inv_mpu.h"
Used: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\InvensenseMotionDriver
Not used: C:\Program Files (x86)\Arduino\hardware\edtracker\avr\libraries\InvensenseMotionDriver
Using library EEPROM in folder: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\EEPROM (legacy)
Using library Wire in folder: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\Wire (legacy)
Using library I2Cdev in folder: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\I2Cdev (legacy)
Using library InvensenseMotionDriver in folder: C:\Users\mvvgr\OneDrive\Documents\Arduino\libraries\InvensenseMotionDriver (legacy)
exit status 1
too few arguments to function 'uint8_t mpu_get_compass_reg(short int
, long unsigned int
)'

EDTracker2_9250.ino (31.5 KB)

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