Adding sensor readings?

How can I add sensor readings so that at the end of a monitoring period I know the total? For example, the sensor reads the following 22, 84, 05... How do I get it to report 111 in this case? Thanks for your help.

If you could elaborate more on what you are trying do it would help but ill try to answer on what i can guess.

The absolutly simplest way to do this. if you don't care about the indevidual numbers (22,84,05) but are only interrested in the sum (111) is to simply add the last reading to a variable

Value = analogRead(pin)
TempVal = StoredVal \ Saves last sum
StoredVal = TempVal + Value \ adds last sum with new number

this what you where looking for?

Yes. All I care about it the sum of the numbers. Thank you for your help!

TempVal = StoredVal \ Saves last sum
StoredVal = TempVal + Value \ adds last sum with new number

Why make a copy of the previous total when you are going to alter the previous total anyway?

Do it all in one step:

Sum += analogRead(pin);

Thanks PaulS! I will give this a try as well.