Normally you'd store in an array as you can reference each entry by a number. What you're trying to do is reference differently-named variables. Ok if you have a small finite number of variables, but will rapidly get out of hand. Use an array:
T[index]=data;
Otherwise, you're looking at:
switch(index)
when 1: T1=data; break;
when 2: T2=data; break;
when 3: T3=data; break;
when 4: cow=data; break;
when 5: chicken=data; break;
etc. forever
You keep saying you want to store time - this is meaningless - In my time zone the last crossing was at approximately 18:29:45.24 - is this what you want to store?
Where are you going to store these times?
How many times do you need to store?
What is your level of experience with code?
What language will this use?
I hope you're better at coding than asking questions.
Where are you going to store these times?
How many times do you need to store?
What is your level of experience with code?
What language will this use?
It would be possible to just measure first time interval then display on screen for 2 second and
then again measure second time interval then display on screen for 2 second just repeat the process continousely
You've finally given some information that means something.
Two seconds equals 100/120 periods. If you store them in microseconds then 16 bits per variable will work.
That means you need 200 or 240 bytes of ram.
You will probably need twice that so you can double buffer the data.
You've finally given some information that means something.
Two seconds equals 100/120 periods. If you store them in microseconds then 16 bits per variable will work.
That means you need 200 or 240 bytes of ram.
You will probably need twice that so you can double buffer the data.
I found in my search that I can use capture mode i to capture the value of Timer 1 when a signal at the CCP pin goes high or low depending on how the CCP is set up. The CCP can accurately capture the arrival time of a signal at the CCP pin. Can I use CCP module to measure time at input signal ?