CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

functions

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
xjackal



Joined: 29 Oct 2005
Posts: 4

View user's profile Send private message

functions
PostPosted: Sat Oct 29, 2005 9:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Oct 29, 2005 9:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Oct 29, 2005 9:56 am     Reply with quote

You should be looking at C tutorials on the net:
http://etude.uwaterloo.ca/~ctrudeau/lessons/C++/tutorial1.html#loop

http://www.lysator.liu.se/c/bwk-tutor.html#while
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group