Giter Site home page Giter Site logo

bme280's People

Contributors

sylaina avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

bme280's Issues

Failure with negative temperature values BME280

Hello,

I have been playing with your great bme280 and i2c library that I have incorporated to my personal arduino nano project with Atmel 328p and SGP30 sensor with LCD 2x16 char library. Congratulations for your work. Everything was working fine until I had the idea of placing the BME280 sensor inside my freezer. As soon as temperature went below zero degrees centigrade, it started to show strange values.

Finally I made it work making some changes in your code:

In file bme280.h:

Changed volatile uint32_t t_fine[SENSORS];
to
volatile int32_t t_fine[SENSORS];

And in bme.c, in fuction float bme280_readTemperature(uint8_t sensor):

I changed:

var1  = ((((adc_T>>3) - ((int32_t)_bme280_calib[sensor].dig_T1 <<1))) *
         ((int32_t)_bme280_calib[sensor].dig_T2)) >> 11;

var2  = (((((adc_T>>4) - ((int32_t)_bme280_calib[sensor].dig_T1)) *
           ((adc_T>>4) - ((int32_t)_bme280_calib[sensor].dig_T1))) >> 12) *
         ((int32_t)_bme280_calib[sensor].dig_T3)) >> 14;

to this, adding two type conversions to int32_t;

var1  =(int32_t) ((((adc_T>>3) - ((int32_t)_bme280_calib[sensor].dig_T1 <<1))) *
         ((int32_t)_bme280_calib[sensor].dig_T2)) >> 11;

var2  =(int32_t) (((((adc_T>>4) - ((int32_t)_bme280_calib[sensor].dig_T1)) *
           ((adc_T>>4) - ((int32_t)_bme280_calib[sensor].dig_T1))) >> 12) *
         ((int32_t)_bme280_calib[sensor].dig_T3)) >> 14;

Now it works fine.
I do not know how all this github think work, sorry if this is not the right way to do. Just I hope it helps.

Regards.
Ramiro

Can't initialize the sensor.

Good day. I can't read the values from the sensor. I'm using your example, the only thing I changed was the I2C address for the sensor. I2C_Error_code returns '24'. But Adafruit_BME280 necessary information from the sensor yet, but I want Arduino, pure C is better.Vedel would you do with it?

Declaration of readHumidity in bme280.h

Hi!

In file bme280.h there may be a problem with line 143, because you wrote "bme280_readHumiditiy". Atmel Studio shows me a warning about this (implicit declaration of function..."

Jorge

compile error

Hi,
I try compile this project and I have the error
pls see the log

"**** Build of configuration Release for project TEST_BME ****

make all
'Building file: ../main.c'
'Invoking: AVR Compiler'
avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega328p -DF_CPU=11059200UL -MMD -MP -MF"main.d" -MT"main.d" -c -o "main.o" "../main.c"
../main.c: In function 'main':
../main.c:14:3: error: too few arguments to function 'bme280_init'
../bme280.h:133:9: note: declared here
../main.c:16:3: error: too few arguments to function 'bme280_readTemperature'
../bme280.h:135:7: note: declared here
../main.c:17:3: error: too few arguments to function 'bme280_readPressure'
../bme280.h:136:7: note: declared here
../main.c:18:3: error: too few arguments to function 'bme280_readHumidity'
../bme280.h:137:7: note: declared here
../main.c:11:9: warning: variable 'humidity' set but not used [-Wunused-but-set-variable]
../main.c:10:9: warning: variable 'pressure' set but not used [-Wunused-but-set-variable]
../main.c:9:9: warning: variable 'temperature' set but not used [-Wunused-but-set-variable]
make: *** [main.o] Error 1

**** Build Finished ****

you can help me fix the problem?
best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.