Hi all
I am doing my coding subject for uni and i am struggling as to why one of my delay routines works correctly but the other does not. My first sub routine simply holds a high logic for 400ms and turns it off like so
My second subroutine is about giving an integer and sending a 6 bit logic to the machine. Basically my pulses all work and everything is fine but the delay does not seem to be the required 200ms that I need:
What i am trying to understand is how are these delays acting differently even though they are the exact same? The highest value i can put in the delay for the second subroutine is 11 which gives a 110ms delay, why is that though?
These codes are both called from the main the same way
Thanks
Mod edit: added code tags
I am doing my coding subject for uni and i am struggling as to why one of my delay routines works correctly but the other does not. My first sub routine simply holds a high logic for 400ms and turns it off like so
C:
void blank() //SUBROUTINE PART 7
{
{
Blankrelease = 1;
Delay10KTCYx(40);
Blankrelease = 0;
}
}
C:
int wind(int n) //SUBROUTINE PART 10
{
int i;
i = n/100;
if(i > 63) return -1;
if (i <= 0) return -1;
{
WindInputPulse = 1;
Delay10KTCYx(20);
WindInputPulse = 0;
}
if(LATD = i)
BUSY = 1;
BUSY = 0;
return 0;
}
These codes are both called from the main the same way
Thanks
Mod edit: added code tags
Last edited by a moderator: