Subject:
|
Re: Yet another Q: IR messages
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Sat, 31 Mar 2001 01:05:45 GMT
|
Viewed:
|
2421 times
|
| |
| |
In lugnet.robotics.rcx.nqc, Tobias Möller writes:
> Thanks for the information so far.
>
> Is there any NQC command similar to the RCX-code "wait until message"-block?
>
> --Tobias
Hi Tobias
I'm not very familiar with NQC events, but if you want to use a blocking
function for receiving your message, use parts of the code i posted before.
int local_message = 0;
int global_message = 0;
task main()
{
//do what you like
ClearMessage();
while (!local_message) // leaves only if message received !!
{
local_message = Message(); // stores message local
Wait(10); //don't know if neccessary ? Try out !
}
ClearMessage(); // Cleares receive buffer
global_message = local_message; // stores message global
local_message = 0; // reset local_message for receiving next
// do what you like after receiving any
// message (in global_message)
}
Rainer
|
|
Message is in Reply To:
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|