Can someone help? I need a simple array humidityArray with 24 values. Every hour I would move offset 22 value into offset 23, 21 into 22 etc.... and put latest value into offset zero... so I would always be able tot total all 24 values once a day and didide that by 24 to give me the daily average humidity... except it isn't working. I'm assuming it is something to do with defining/initialising the array which happens when node red powers up... this should be a simple calculation but a day later I can't get offset value above offset 2 to fill in. I initialise all 24 offsets to -1 when node red powers up... that much seems to work.
offset 0 gets the latest value and next iteration this should get shoved up one with the oldest value falling off the end.
Someone please put me out of my misery.