guys sorry for these starter questions but i couldnt understand what is
while(TRUE){ stament does.does it work while one of the conditions are "true" or how?
and i cant understand example like !--> while(!input(PIN_BO));
does this mean when NOT ?but is it low or high?
thnx
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
Posted: Sat Oct 29, 2005 9:52 am
The main() function is the function that is run when the PIC starts. Normally, in the main() is a while(TRUE) statement. TRUE is #defined as 1 previously in the code somewhere. So.... The while(TRUE) statement will repeat over and over.
Code:
main() {
startup stuff
while(TRUE) {
repetitive stuff here
}
}
The input(PIN_B0) statement reads the B0 pin. So..... while(!input(PIN_B0)) will repeat while PIN_B0 is low or 0 or FALSE... any way you want to describe it.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum