Home/Support/Support Forum/count the time between a cycle
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

count the time between a cycle

0 votes
I want to count the time between a cycle.
Everytime my signal is hight the time counter should start and when the signal is high again it should stop.

A cycle takes about 10ms.

int Lichtschranke;
int Lichtschranke1;
unsigned long int T2=0;
unsigned long int T0=0;


Lichtschranke = RdPortI(PEDR);
Lichtschranke1 = Lichtschranke & 0x01;


if((Lichtschranke1 == 1))
{
T0=TICK_TIMER;
Lichtschranke = RdPortI(PEDR);
Lichtschranke1 = Lichtschranke & 0x01;

if((Lichtschranke1 == 1))
{
T2=(TICK_TIMER-T0);


}
}
asked Nov 14, 2013 in Rabbit Software by zizou0816 New to the Community (0 points)

Please log in or register to answer this question.

...