mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
To get and average the temperature so it is more accurate, especially in low temperature
This commit is contained in:
parent
26321162ee
commit
0b30d2433f
1 changed files with 8 additions and 1 deletions
|
|
@ -44,7 +44,14 @@ public:
|
||||||
|
|
||||||
// Temperature from ESP32 MCU
|
// Temperature from ESP32 MCU
|
||||||
float getMCUTemperature() override {
|
float getMCUTemperature() override {
|
||||||
return temperatureRead();
|
uint32_t raw = 0;
|
||||||
|
|
||||||
|
// To get and average the temperature so it is more accurate, especially in low temperature
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
raw += temperatureRead();
|
||||||
|
}
|
||||||
|
|
||||||
|
return raw / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t getStartupReason() const override { return startup_reason; }
|
uint8_t getStartupReason() const override { return startup_reason; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue