wildbill, thank you for your suggestions, much appreciated.
I followed your suggestion and corrected my contrains:
hum1MinIndex=constrain(hum1MinIndex,0,5); //constrain indexes
hum1HourIndex=constrain(hum1HourIndex,0,59);
hum24HourIndex=constrain(hum24HourIndex,0,23);
temp1MinIndex=constrain(temp1MinIndex,0,5);
temp1HourIndex=constrain(temp1HourIndex,0,59);
lcdState=constrain(lcdState,0,5);
averageHum1Min=constrain(averageHum1Min,0.0,100.0);
This now reflects the actual sizes of all the arrays, so no more array bounds violations I hope.
I updated my code above.
I also added two different freeRam functions I found online:
#include <MemoryFree.h>
Serial.print(freeMemory());
and
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
Serial.print(freeRam());
I'll upload this afternoon, and report back here.
Fingers crossed and thanks again!