Zwer2k / WeatherStationDataRx

Arduino library for read weather data from Venus W174/W132 (tested), Auriol H13726, Hama EWS 1500, Meteoscan W155/W160
MIT License
22 stars 8 forks source link

Age of received data #12

Closed rforro closed 3 years ago

rforro commented 3 years ago

How about include function that delivers how old the data is aka how many seconds ago was the data received from sensor. It could be based on millis() and the actual value will be stored while pushing into ring-buffer. Than you can anytime calculate difference between stored and actual value in order to obtain their age.

Zwer2k commented 3 years ago

However, the times must then also be in the ring buffer for each sensor, as different values are measured at different times. Of course the information requires additional memory. Why do you need the times? The return value of readData() contains the information if there are new values for a certain sensor. If you call the function regularly and evaluate the return value you should always have current data.

rforro commented 3 years ago

I've written this before I understood how the read function removes the read value. Now I don't think, that it's crucial to know the timestamp. Thanks anyway.