Yes, there are routines for long shift left and long shift right and signed multiplies at the end of the library.
Your change sounds logical. try it out!
This library could be rewritten now that you have floats working. I don't know if i have the energy to do that. The present library took a year (long winter ) to do.
GL
Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a question, if you can remember the answer.
In Data Sheet Section 4.2.3 Compensation formulas, it says:
"Both pressure and temperature values are expected to be received in 20 bit format,
positive, stored in a 32 bit signed integer. Humidity is expected to be received in 16 bit format,
positive, stored in a 32 bit signed integer."
But Table 16 shows the dig_xx compensation values as one or two bytes.
Table 18 shows the pressure and temperature data is three bytes and humidity is two bytes.
So, what does " stored in a 32 bit signed integer" mean?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been looking at the bmp.h include file and noticed a possible error.
In lines 527 to 531 it says:
end function
Based on the first line 'Press = Press + ((var2 + var1 + dig_P7)/16)
It seems that this line Press = BMPshiftR(Press,4) + Press
should read:
Press = BMPshiftR(BME280_LongTemp,4) + Press
Am I correct?
Yes, your change makes sense.
But, does the BMPshift() function support Long?
It has been a long time since i made this.
Yes, there are routines for long shift left and long shift right and signed multiplies at the end of the library.
Your change sounds logical. try it out!
This library could be rewritten now that you have floats working. I don't know if i have the energy to do that. The present library took a year (long winter ) to do.
GL
Mike
I would recommend keeping with integers. It is portable code, as the AVR does not currently support floats, and it will be faster.
mmotte,
I have a question, if you can remember the answer.
In Data Sheet Section 4.2.3 Compensation formulas, it says:
"Both pressure and temperature values are expected to be received in 20 bit format,
positive, stored in a 32 bit signed integer. Humidity is expected to be received in 16 bit format,
positive, stored in a 32 bit signed integer."
But Table 16 shows the dig_xx compensation values as one or two bytes.
Table 18 shows the pressure and temperature data is three bytes and humidity is two bytes.
So, what does " stored in a 32 bit signed integer" mean?
Does it mean iEEE format ?
Egg on my face. I can't find the demo code and I lost the laptop that I developed it on. There is a back up somewhere...argh ...not in demos
" stored in a 32 bit signed integer" mean?
It talks about fixed point math. So is that why all the shifting is done? i am not sure
So the compensation, are they doing curve fitting?
That is my 2 guesses.
mike
Thanks!