View previous topic :: View next topic |
Author |
Message |
xjackal
Joined: 29 Oct 2005 Posts: 4
|
functions |
Posted: Sat Oct 29, 2005 9:39 am |
|
|
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.
Good luck,
John |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
 |
|