BlueDot-Arduino / BlueDot_BME280

14 stars 9 forks source link

1.0.8 does not work with Arduino 1.8.5 / Mega256 #5

Open rtammer opened 6 years ago

rtammer commented 6 years ago

Hello, The Arduido 1.8.5 IDE (Mega 256) does complain about Wire.begin(0,2).

According to the docs there is no second parameter to Wire.begin();.

Bye Rainer

BlueDot-Arduino commented 6 years ago

Hello Rainer,

Thank you for point it that out, I haven't noticed it. The Wire.begin() can have a second parameter, but it works only with the ESP8266 board. I made a mistake implementing this function on version 1.0.8 and, as you have already noticed, it creates problems when you try to compile with the regular Arduino boards.

I already corrected the .cpp file on github a while ago, but forgot to create a new version. The Arduino Library Manager still has the wrong version, which probably caused the error with your board.

You can download the new 1.0.9 version on github right now or wait an hour or so for the version to be available on the Arduino Library Manager. The version 1.0.8 will be deactivated.

Please let me know if you are still having difficulties compiling this library with your board.

Best Regards, Thiago

rtammer commented 6 years ago

Hello, Thanks very much for the fast answer/update.

Did you see the second issue I have entered on github (missing cast)?

Bye Rainer

On Sun 3. Jun 2018 at 12:24, BlueDot notifications@github.com wrote:

Hello Rainer,

Thank you for point it that out, I haven't noticed it. The Wire.begin() can have a second parameter, but it works only with the ESP8266 board. I made a mistake implementing this function on version 1.0.8 and, as you have already noticed, it creates problems when you try to compile with the regular Arduino boards.

I already corrected the .cpp file on github a while ago, but forgot to create a new version. The Arduino Library Manager still has the wrong version, which probably caused the error with your board.

You can download the new 1.0.9 version on github right now or wait an hour or so for the version to be available on the Arduino Library Manager. The version 1.0.8 will be deactivated.

Please let me know if you are still having difficulties compiling this library with your board.

Best Regards, Thiago

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BlueDot-Arduino/BlueDot_BME280/issues/5#issuecomment-394152177, or mute the thread https://github.com/notifications/unsubscribe-auth/AmBvQHdbLcBRBSdE7EhSDahbxKy5mBoxks5t47lGgaJpZM4UX_yj .

-- Bye Rainer Tammer

BlueDot-Arduino commented 6 years ago

Hello Rainer, I just saw your second issue, but I couldn't reproduce the error message. Although I don't own an Arduino Mega, I've set the Arduino IDE to compile to the ATMega2560 and I could compile the library version 1.0.9 without any problems. Did you try the latest version of the library with your board? Perhaps both issues were related...

Best Regards Thiago

rtammer commented 6 years ago

Hello, Here is the exact error message:

Library: 1.0.9

C:\Arduino\libraries\BlueDot_BME280_Library\BlueDot_BME280.cpp: In member function 'uint8_t BlueDot_BME280::readByte(byte)':

C:\Arduino\libraries\BlueDot_BME280_Library\BlueDot_BME280.cpp:430:42: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:

Wire.requestFrom(parameter.I2CAddress,1);

                                      ^

In file included from C:\Arduino\libraries\BlueDot_BME280_Library\BlueDot_BME280.h:9:0,

             from

C:\Arduino\libraries\BlueDot_BME280_Library\BlueDot_BME280.cpp:10:

C:\Users\devel\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\Wire\src/Wire.h:64:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)

 uint8_t requestFrom(int, int);

         ^

C:\Users\devel\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\Wire\src/Wire.h:61:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)

 uint8_t requestFrom(uint8_t, uint8_t);

         ^

Der Sketch verwendet 22366 Bytes (8%) des Programmspeicherplatzes. Das Maximum sind 253952 Bytes. Globale Variablen verwenden 1135 Bytes (13%) des dynamischen Speichers, 7057 Bytes für lokale Variablen verbleiben. Das Maximum sind 8192 Bytes.

Simple solution:

Wire.requestFrom(parameter.I2CAddress, (byte)1);

Bye Rainer

On Sun, Jun 3, 2018 at 6:14 PM, BlueDot notifications@github.com wrote:

Hello Rainer, I just saw your second issue, but I couldn't reproduce the error message. Although I don't own an Arduino Mega, I've set the Arduino IDE to compile to the ATMega2560 and I could compile the library version 1.0.9 without any problems. Did you try the latest version of the library with your board? Perhaps both issues were related...

Best Regards Thiago

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BlueDot-Arduino/BlueDot_BME280/issues/5#issuecomment-394172890, or mute the thread https://github.com/notifications/unsubscribe-auth/AmBvQCGqW2e4quOAexC4nDBJIEAMjb0nks5t5AtMgaJpZM4UX_yj .

-- Bye Rainer Tammer