Timmers and Calculating slope

Hi Everyone , i am new to the arduino programming. I am working on the capacitive sensor. When the sand level increases the vol drops and after some time stabilises to constant value. I have to measure the time required to drop from one stable voltage level to the other stable voltage level. also i have to calculatet the slope of this somewhat exponential decay. I have to use the timmers for measuring the time difference. Can anyone tell me what will be the good starting point for studying how to use timmers in Arduino programming? Also i might have to collect some data and store it in memory for anlysys. How can we access the memory and store data in Arduino?

Any help will get me going on the project.

Thanks A lot! ::)

How can we access the memory and store data in Arduino?

Variables access the memory, data should be stored in variables or arrays of variables unless you want the data to be persistent over power down, then you should use the E2 (Eee squared) memory. However beware of this because the number of times you can write to it is limited to about 100,000 times.

You don't say what time scale you are looking at but the millis() counter is probably all you will need for this. This is the sort of thing to do.

long int startTime, totalTime; if(voltage == startVoltage) startTime = millis() if(voltage == endVoltage) totalTime = millis() - startTime

Thanks Grumpy_Mike,

i am thankful for your reply. I am actually looking for the timmer of 25-30 sec. But i think millis() can also work. I think its easy to use timmer in Arduino. i was thinking that i might have to set some values in the port as we do for normal microcontrollers.

Anyway i will try out some codes.

thank you.

I am actually looking for the timmer of 25-30 sec.

Yes but in a micro controller all timing is derived from the basic system clock (unless you use an external oscillator) so any interval is going to be the result of counting a lot of short ticks.