You might want to build a queue with two values. One for longterm and one for last boot. In the last boot queue you always overwrite with the currently measured value. If the last measured value is zero or lower than whats stored in the last boot queue, add last boot to the longterm qeue and reset the last boot queue to zero.
Your grand total will then be the sum of the last boot and longterm value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.