finitespace / BME280

Provides an Arduino library for reading and interpreting Bosch BME280 data over I2C, SPI or Sw SPI.
GNU General Public License v3.0
210 stars 105 forks source link

'NAN' error running in Energia #24

Closed roboflank closed 7 years ago

roboflank commented 7 years ago

Am trying to run the program in energia and am getting the following error. BME_280_I2C_Test:78: error: 'NAN' was not declared in this scope exit status 1 'NAN' was not declared in this scope.

roboflank commented 7 years ago

am using the i2c code example

theopensourcerer commented 7 years ago

I've not used Energia but I do use this in PlatformIO and it works fine.

Have you tried it in an another IDE?

What platform (MCU) are you building for?

finitespace commented 7 years ago

denzelwamburu,

NaN (not a number) is a C++ 99/11 construct. Do you have the capability in Energia to specify using the C++ 11 compiler? If not you may need to define NAN in the BME280 file as well as the function isnan();

Tyler

finitespace commented 7 years ago

You can put something along the lines of:

define NAN 1e+30 / _HUGE_ENUF/

define isnan(n) n == float(NAN)

in the top of your BME280.cpp file.

Tyler

roboflank commented 7 years ago

Hi @finitespace , let me look at it tomorrow and give you the feedback. Thanks.

roboflank commented 7 years ago

@theopensourcerer MSP430

roboflank commented 7 years ago

@finitespace Where exactly should this be placed? Putting it on the define sections of BME280.cpp doesn't solve the issue.

finitespace commented 7 years ago

At the top of the BME280.cpp file should work.

Tyler

Sent from iPhone

On Apr 17, 2017, at 11:53 PM, Wamburu notifications@github.com wrote:

@finitespace Where exactly should this be placed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.