How to add the previous value to current value from sensor
Btw, you can make the volatile variables global, by putting them above void Setup.
To put the total (new) value, use:
total += &lt;sensorValue&gt;;

where &lt;sensorValue&gt; is a call to get the sensorValue (or the value that has the sensor value stored in it), but I cannot see that in your sketch.
total += 0.3;

is the same as writing:
total = total + 0.3;

The value right of the '='sign is copied (assigned) to the left part of the '=' sign.