What does this compiler warning mean ?

What does this compile (verbose) warning mean ?

What does "candidate" refer to ?

...
...
C:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\variants\d1_mini -IC:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\Wire C:\DOCUME~1<USRNM~1>\LOCALS~1\Temp\build7097269456001987403.tmp\MPU6050finally.cpp -o C:\DOCUME~1<USRNM~1>\LOCALS~1\Temp\build7097269456001987403.tmp\MPU6050finally.cpp.o

In file included from MPU6050finally.ino:5:0:

C:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\Wire/Wire.h: In function 'void loop()':
C:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\Wire/Wire.h:70:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int, int)
    uint8_t requestFrom(int, int, int);
            ^
C:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\Wire/Wire.h:64:12: note: candidate 2: size_t TwoWire::requestFrom(uint8_t, size_t, bool)
    size_t requestFrom(uint8_t address, size_t size, bool sendStop);
            ^
C:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\Wire/Wire.h:70:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int, int)
    uint8_t requestFrom(int, int, int);
            ^
C:\Documents and Settings<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\Wire/Wire.h:64:12: note: candidate 2: size_t TwoWire::requestFrom(uint8_t, size_t, bool)
    size_t requestFrom(uint8_t address, size_t size, bool sendStop);
            ^



Using previously compiled file: C:\DOCUME~1\<USRNM~1>\LOCALS~1\Temp\build7097269456001987403.tmp\Wire\Wire.cpp.o
C:\Documents and Settings\<username>\Application Data\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Documents and Settings\<username>\Application Data\Arduino15\packages\esp8266\hardware\esp8266\2.4.1/tools/sdk/include -I
...
...

the < code > section is what was in the orange font, while the rest were the white font (not the full text).

i had been testing a MPU6050 on an Arduino Uno and have now just moved it to a WemosD1 (ESP8266).

it seemed to run okay at first and then went haywire (servo.pos went to extremes due to (what i later discovered) were blank readings.

i had switched to the basic example sketch (just simple reading values) which worked - at first, but then afterwards didn't.

is the above compile warning related ?

i'm not sure what it means - do i have to fix/edit the library ?

i just noticed this other thread on Page One which perhaps is related ?
http://forum.arduino.cc/index.php?topic=559908.msg3823178#msg3823178

thanks for any insight, or pointers to a general link to understanding Arduinio IDE compiler warnings. (there didn't seem to be any "explanatory text" included with the above)

it just compiled and uploaded.

Just for info;
The actual code is the example code

void loop () {

Wire.beginTransmission(MPU_addr);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true);
AcX=Wire.read()<<8|Wire.read();

<< ...etc...6 more similar lines >>

<< and then Serial.println(those respective registers) >>

The datatype of MPU_addr is important. You failed to included the definition / declaration.

my apologies for the earlier laziness.

here is the full actual code

// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include<Wire.h>
const int MPU_addr=0x68;  // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
  Wire.begin();
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x6B);  // PWR_MGMT_1 register
  Wire.write(0);     // set to zero (wakes up the MPU-6050)
  Wire.endTransmission(true);
  Serial.begin(9600);
}
void loop(){
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  AcX=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)     
  AcY=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  AcZ=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GyX=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GyY=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GyZ=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  Serial.print("AcX\t"); Serial.print(AcX);
  Serial.print("\tAcY\t"); Serial.print(AcY);
  Serial.print("\tAcZ\t"); Serial.print(AcZ);
  Serial.print("\tTmp\t"); Serial.print(Tmp/340.00+36.53);  //equation for temperature in degrees C from datasheet
  Serial.print("\tGyX\t"); Serial.print(GyX);
  Serial.print("\tGyY\t"); Serial.print(GyY);
  Serial.print("\tGyZ\t"); Serial.println(GyZ);
  delay(333);
}

at the very top of the compile verbose output it does say using Wire-library in the esp8266 directory, as opposed to the standard one when using Uno.

The compiler is trying to decide which of these two to call...

  uint8_t TwoWire::requestFrom(int, int, int)

  size_t TwoWire::requestFrom(uint8_t, size_t, bool)

You passed a bool for the last parameter so I assume you meant to call the last one.

The problem is that you passed an int for the first parameter (MPU_addr). Because of the discrepancy the compiler does not know what you want. From the message it is not clear which method is actually called. I suspect the first.

Correct the datatype for MPU_addr.

i see, is that normal for a library to have more than one option as valid ?
(should i just comment out the "triple-int" version)

and that would be done by changing;
const int MPU_addr=0x68 to
const uint8_t MPU_addr=0x68, right?

BabyGeezer:
i see, is that normal for a library to have more than one option as valid ?

That is entirely the choice of the developer. There is no "normal" when it comes to such choices.

For what little it's worth, I detest method overloading. I find it to be a bastion of laziness on the part of API designers.

(should i just comment out the "triple-int" version)

I wouldn't. You can easily get past the warnings without resorting to something so drastic.

and that would be done by changing;
const int MPU_addr=0x68 to
const uint8_t MPU_addr=0x68, right?

Exactly.

heh-heh, your "diplomacy" is a bit lacking :slight_smile:
(or maybe it's actually good - because it leaves no ambiguity :smiley: )

you're polite in saying "no normal" but then reveal your position afterwards !
i'm with you actually - i wonder, though, why the compiler shows the warning twice, on just one 'instance'(?) of 'requestFrom'

i just had a look at the compile output with the Uno and it had the same thing !

so it wasn't really the issue - it was infact the I2C bus itself - i think i have to add pull-up resistors, which wasn't required on the Uno board - whereas the Wemos had an OLED (not active but VCC+GND connected) on the I2C bus also.

i think the Wemos has internal pull-ups as well, the OLED screen worked okay when being tested - but now with two devices on the bus, something has definitely changed.

BabyGeezer:
i wonder, though, why the compiler shows the warning twice, on just one 'instance'(?) of 'requestFrom'

Don't know.

i just had a look at the compile output with the Uno and it had the same thing !

I cannot reproduce. Odd.

BabyGeezer:
is that normal for a library to have more than one option as valid ?

Yes, otherwise Serial.print() would not know to print 0xFFFFU as "65535" and 0xFFFF as "-1" and 1f as "1.00". The function that gets called depends on what the argument type is.