How to add the previous value to current value from sensor const byte interruptPin = 4;
void ICACHE_RAM_ATTR count();
void setup() {
  Serial.begin(115200);

  // Set up our digital pin as an interrupt
  pinMode(interruptPin, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(interruptPin), count, RISING);
}

void loop() {

}

void count() {
  volatile float rainrate = 3;
  volatile float rate;
  volatile float total;

  rate = rainrate * 0.1; 
  Serial.println(rate);


Every time it tips, it returns 0.3.  How do I add the previous value(0.3) to a new tip, to make it 0.6, and save it into a variable.
Thanks!
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.