Array problem

Why???

Maybe if you numbered BOTH arrays and BOTH indexes, so you KNOW that you are not mistakenly using the wrong index with an array.

button = analogRead(analogButton);
button2 = analogRead(analogButton2);

So you can read that a switch is barely pressed, halfway pressed, really mashed?

Just what ARE you reading?

  // read from the sensor:
  readings[readIndex] = volume;

That is NOT what the code does. Your array to average the volumes has a really stupid name!

  readings2[readIndex2] = sht1x.readTemperatureC() + 5;

Another example of a useless name!