Replies: 6 comments 4 replies
-
In Berry, you can use list objects as indexed arrays. I'd expect the list to occupy more than 2400 bytes, but with only 600 values, you should not get into trouble. Simple calculations on at small array of 600 elements should be no problem several times a second, but obviously does depend on specifics. Any loop code you have will be blocking, meaning that fast loop cannot get in between. If you monitor timing to see it becoming "too slow", you could split list processing into segments of 100 (or whatever fits), and use List processing with index access in a loop Of course, you also have the basic |
Beta Was this translation helpful? Give feedback.
-
There is an alternative average algorithm that uses nearly no resources. Most of the time more than good enough. avg = (newValue + avg * 600) / 601 hope it helps |
Beta Was this translation helpful? Give feedback.
-
Thx guys. |
Beta Was this translation helpful? Give feedback.
-
you can make it much better during start if instead of 600 you use min(collectedTimes, 600). edit: and of course use that min + 1 for the division. |
Beta Was this translation helpful? Give feedback.
-
off topic... Is it possible to display my calculations here: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi,
I use Esp32 and a powermeter. Every 1sec I get a new reading of voltage (let's assume 1 phase).
I'd like to calculate a moving average of Voltage in a 10 minute window.
I have no clue on how to approach this problem.
Thx for any help/suggestions.
Beta Was this translation helpful? Give feedback.
All reactions