How can I collect all data in one array

Hello everyone,

I want to collect data coming from a sensor in an array. The sensor output is actualised every 1 sec. Every time a new value comes only 1 value will be stored in my array and the other values are 0.
here a simple example : 3 values injected 21, 10 and 15, I get [21 0 0] , [0 15 0 ] and [0 0 10].
I want to get this array [21 15 10] , where every value that changes is stored.

Any ideas how can I sove this problem with function or any other Note?

using the join node possibly? play around with it.

[{"id":"cec5d1533e6f103e","type":"join","z":"e9ac22a1.fe877","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"10","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":210,"y":560,"wires":[[]]}]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.