Open kevinjwalters opened 3 years ago
Test this with interval 0.2 and passive mode to get the plot zipping along.
plotters_combined
uses the feature of supplying less values than are declared by colour listAfter auto_discard
addition, Feather nRF52840 Express on 6.0.0
:
Four lines, 3 ramping took 20.0684 seconds
Four lines, 3 ramping took 15.576 seconds
Three flat lines took 16.8184 seconds
Three flat lines took 15.1393 seconds
Two lines, few draws took 13.2486 seconds
Two lines, few draws took 12.5482 seconds
Alternating, missing took 13.6402 seconds
Alternating, missing took 11.7799 seconds
plotters_combined
(00e159014dd3b51120b3783ec83452e30abe8424) now runs better on the Feather nRF52840 Express with PMS5003 attached. Goes from 53648 bytes free at end of updates to steady state of around 31088 bytes.
The example https://github.com/pimoroni/EnviroPlus-FeatherWing/blob/master/examples/plotters_combined.py is robust wrt memory usage until the PMS5003 is added on a Feather nRF52840 Express. With that additional sensor and associated graph it then blows up after about 15 minutes with a
MemoryError
:Assuming this isn't a leak there's probably some efficiency measure that can improve the situation here. Pre-allocation of
self.data_points
and storing number of valid entries would probably help. This is the approach taken here with an implementation of a circular buffer for the width of screen plus pendingextra_data
awaiting being drawn viadraw()
(plus 1 based on how the implementation works).A crude fix might be to allow the width of plot to be specified and simply reduce it from the default 160.