float gallons = measureINches() * 0.125; // or so
gallons = int(gallons *4) / 4.0; // This rounds down to quarter gallons
That sounds like it will work! Let me give it a try.
If the sensor is measuring the distance to the liquid, how does adding liquid INCREASE the distance?
This is a function that is currently working. I added a tare function and afterwards put in a statement that reads
gallons = tare - inches;