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

Please check my code...

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



Joined: 23 Sep 2003
Posts: 12
Location: South KOREA

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

Please check my code...
PostPosted: Wed Feb 16, 2005 7:37 pm     Reply with quote

Dear Master.

Hi there?

I have aquestion.
I wanna use E-Stop...

void start()
{
while(C0 != ON)
{
....
}
}


void main()
{
while(1)
{
if(B1 == ON) start();
}
}

I think When C0 is ON than can't play start()
but C0 is OFF than can play Start()

Is this collect CODE?

Please check..
_________________
Hello~?

This is South KOREA
My name is Sanghyouk Kim But Call me Nick
Sorry I'm poor English
EdWaugh



Joined: 07 Dec 2004
Posts: 127
Location: Southampton, UK

View user's profile Send private message

hey
PostPosted: Thu Feb 17, 2005 8:25 am     Reply with quote

hi,

I think Dear Sir is probably what you meant there!
Anyway, assuming your using the CCS compiler I think what you want to do might look like this:

Code:

void start()
{
   while(!input(pin_c0))        // this is a fast way of checking a single bit
   {                                    // you don't need == or !=
    ....
    }
}
void main()
{
while(1)
{
    if(input(pin_b1)) start();
}
}

Have a look in the manual for the input() fn.

ed
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