Strange readings or bug ADXL335-BB with ArduLog?

I tried that but that didn't make a difference.

Just for clarity, the 40 consecutive readings only happen in my test sketch (ADXL335_READ) not in the problem sketch (ardulog_rtc_analogue_read).

I'm confident the ADXL335_READ does confirm analogRead works fine on both IDE 1.8.2 and 1.6.0 at the default read frequency (default settings on ADC). My readings are between 400 and 500 each. 40*500=20,000 < 32,767 for int.

I tested on both Arduino Uno and ArduLog and the readings are sensible. I converted raw readings to g-force and the readings make sense.

Problems happened in the other sketch that I could run on the ArduLog only. Changing IDE from 1.8.2 to 1.6.0 did resolve the issue with the ardulog_rtc_analogue_read sketch. So I think the problem is with the IDE.