You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently doing a project with an ESP32 where I need to store and transmit data over the internet from a DHT22, it would be nice to be able to use the 4-byte raw data from the sensor, as that is a smaller size that unnecessarily storing the floats. I propose a public function that simply allows a programmer to read the raw data of the sensor. Something like:
const byte* getRawData() const { return data; }
The programmer would be responsible for calling read() prior to this (or I suppose it could be integrated into the function and a nullptr returned if it fails).
The text was updated successfully, but these errors were encountered:
redbart
changed the title
Add a public getRawData() function
Improvement: Add a public getRawData() function
Feb 8, 2021
I had a similar complaint a few years ago when I was using this library. I was storing the read values in integer format anyway so I needed to convert the floats back to integers. On Arduino boards with no FPU and limited program memory, this may needlessly increase program size, along with decreasing performance and overall being “less elegant”.
I am currently doing a project with an ESP32 where I need to store and transmit data over the internet from a DHT22, it would be nice to be able to use the 4-byte raw data from the sensor, as that is a smaller size that unnecessarily storing the floats. I propose a public function that simply allows a programmer to read the raw data of the sensor. Something like:
const byte* getRawData() const { return data; }
The programmer would be responsible for calling read() prior to this (or I suppose it could be integrated into the function and a
nullptr
returned if it fails).The text was updated successfully, but these errors were encountered: