[LR11x0] Fix temperature reading (#1234)
* Update LR11x0.cpp According LR1121 datasheet * Update LR11x0.cpp Now OK * Update LR11x0.cpp Now OK
This commit is contained in:
parent
af27e44a52
commit
a68df0f515
1 changed files with 2 additions and 1 deletions
|
@ -2121,7 +2121,8 @@ int16_t LR11x0::getTemp(float* temp) {
|
|||
// pass the replies
|
||||
if(temp) {
|
||||
uint16_t raw = ((uint16_t)(buff[0]) << 8) | (uint16_t)buff[1];
|
||||
*temp = 25.0f - (1000.0f/1.7f)*(((float)raw/2047.0f)*1350.0f - 0.7295f);
|
||||
raw = raw & 0x07FF; //According LR1121 datasheet we need [0..10] bits
|
||||
*temp = 25.0f - (1000.0f/1.7f)*(((float)raw/2047.0f)*1.35f - 0.7295f); //According LR1121 datasheet 1.35
|
||||
}
|
||||
|
||||
return(state);
|
||||
|
|
Loading…
Add table
Reference in a new issue