how to the interval of analoginput

im using air pressure gauge sensor and its analog input how i get the interval every pressure i give to him

this is my codes

void setup() { Serial.begin(9600); } void loop() { while (analogRead(0) == 0); while (analogRead(0) != 0); int T1 = millis(); while (analogRead(0) == 0); while (analogRead(0) != 0); int T2 = millis(); unsigned long i = 60000L; i = i/T2-T1; Serial.println(i); }

how i get the interval every pressure i give to him

T2 - T1 is the interval, though not the peak-to-peak time, which is probably more important.

i is a lousy name for a variable. fred is better, but dtill useless as it does not provide a clue as to what you think the value that it holds represents.

KevinCastillo:
im using air pressure gauge sensor and its analog input how i get the interval every pressure i give to him

Give to who? What pressure? You aren’t sending any pressure to anyone in this code.

This
int T1 = millis();
should be
unsigned long T1 = millis();

…R