Thanks LarryD
Thanks KenF
i already tried pulseIn() function ,but its not working i got only 0 value in the result ,may be i did something wrong with he connection.
The polarity of the wires is as follows:
Brown wire: 24V Input
Blue wire: 24V Return
white wire: Pulse Output
Green wire: Pulse Return
Red wire: 4-20mA Output (+)
Black wire: 4-20mA Return (-)
i connected white wire(Pulse Output) to pin number (2) and Green wire(Pulse Return) to Arduino GND between pin 13 and AREF , but i got only 0 as a result.
here is a sample code:
int pin = 2;
unsigned long duration;
void setup()
{
pinMode(pin, INPUT);
Serial.begin(9600);
Serial.println("Started");
}
void loop()
{
duration = pulseIn(pin, HIGH);
Serial.println(duration, DEC);
}
but i got only 0 as a result in my hyper-terminal, so may you help me to get the correct pulse?
and how can i get pulse count from the duration ?
once again thanks in advance.