https://github.com/sparkfun/pxt-weather … it.ts#L187
Hi all, I’m questioning about the weatherbit.rain() function, after many attempts I’ve not come up with a solution, yet.
I’ve not understood how that function works, when the variable numRainDumps is cleared?
Let me explain: every 5 minutes I get new data from the various sensors in the weaterbit, and if the function rain() returns a value greater than 0 I save this value in a variable “fallingRain”. Imagine it rains for 20 minutes, it correctly save the value. But, after some minutes rain ends, the rain() function doesn’t returns the previous falling rain, but it returns 0 again… Even if in the code in the link there’s no time where the variabile numRainDumps is cleared, so how it’s possible that rain() returns 0? Ans if it’s so, how can I save the value and clear it manually only at midnight? Thanks a lot for helping!