From e766b8d19b0cba8b3999e44c6fec2ad351e876ed Mon Sep 17 00:00:00 2001 From: mixeysan <81270595+mixeysan@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:16:56 +1000 Subject: [PATCH 1/3] Update LR11x0.cpp According LR1121 datasheet --- src/modules/LR11x0/LR11x0.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index cbda7ddb6..28c6a4367 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -2121,7 +2121,7 @@ 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); + *temp = 25.0f + (1000.0f/1.7f)*(((float)raw/2047.0f)*1.3500f - 0.7295f); } return(state); From 656bc169c6e4a3e986c956e07852a890eb9c6a65 Mon Sep 17 00:00:00 2001 From: mixeysan <81270595+mixeysan@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:47:43 +1000 Subject: [PATCH 2/3] Update LR11x0.cpp Now OK --- src/modules/LR11x0/LR11x0.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index 28c6a4367..c148bb9b1 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -2121,7 +2121,7 @@ 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)*1.3500f - 0.7295f); + *temp = 25.0f - (1000.0f/1.7f)*(((float)raw/2047.0f)*1.3500f - 0.7295f); } return(state); From 39ee0ffab26839c4da31cee04c790e3bae7b96dd Mon Sep 17 00:00:00 2001 From: mixeysan <81270595+mixeysan@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:54:17 +1000 Subject: [PATCH 3/3] Update LR11x0.cpp Now OK --- src/modules/LR11x0/LR11x0.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index c148bb9b1..81eb9ade0 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -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)*1.3500f - 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);