vpominchuk / lightmeter

Lightmeter/Flashmeter for photographers, based on Arduino.
GNU General Public License v3.0
97 stars 32 forks source link

Error on compile #7

Open billbill100 opened 1 year ago

billbill100 commented 1 year ago

Hi, Using UDE 2.0.3 and library BH1750 by Christopher Laws, version 1.3.0

In file included from C:\Users\Nigel\Documents\Arduino\lightmeter-master\lightmeter-master\src\lightmeter\lightmeter.ino:76:0: C:\Users\Nigel\Documents\Arduino\lightmeter-master\lightmeter-master\src\lightmeter\lightmeter.h: In function 'float getLux()': C:\Users\Nigel\Documents\Arduino\lightmeter-master\lightmeter-master\src\lightmeter\lightmeter.h:52:49: error: no matching function for call to 'BH1750::readLightLevel(bool)' uint16_t lux = lightMeter.readLightLevel(false); ^ In file included from C:\Users\Nigel\Documents\Arduino\lightmeter-master\lightmeter-master\src\lightmeter\lightmeter.ino:7:0: c:\Users\Nigel\Documents\Arduino\libraries\BH1750-master\src/BH1750.h:70:9: note: candidate: float BH1750::readLightLevel() float readLightLevel(); ^~~~~~ c:\Users\Nigel\Documents\Arduino\libraries\BH1750-master\src/BH1750.h:70:9: note: candidate expects 0 arguments, 1 provided

exit status 1

Compilation error: no matching function for call to 'BH1750::readLightLevel(bool)'

Seems to be line 52 uint16_t lux = lightMeter.readLightLevel(false);

Now, if I remove the word 'false' so the line is as below, the code compiles without error

uint16_t lux = lightMeter.readLightLevel();

I have no idea what the 'false' does in the code, I wonder if it is there to wait for the read cycle from the sensor is complete?

Looking at the advanced example file, (pasted below), I'm wondering if the library file has been updated so one now uses something like 'if (lightMeter.measurementReady(true))' instead of the 'false' argument?

Help/advise appreciated. thanks.

void loop() { // we use here the maxWait option due fail save if (lightMeter.measurementReady(true)) { float lux = lightMeter.readLightLevel(); Serial.print(F("Light: ")); Serial.print(lux); Serial.println(F(" lx"));

if (lux < 0) {
  Serial.println(F("Error condition detected"));