| | Re: "Speed" of control statments
|
|
Actually, its not a general programming question. Efficiency of something like events is heavily dependent on the operating system (in this case the Lego firmware). Efficiency of "if" vs. "switch" can be very dependent on the compiler and the CPU (...) (24 years ago, 31-Mar-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: Yet another Q: IR messages
|
|
Thanks for the information so far. Is there any NQC command similar to the RCX-code "wait until message"-block? --Tobias (24 years ago, 30-Mar-01, to lugnet.robotics.rcx.nqc)
|
|
| | "Speed" of control statments
|
|
I have been currently working on a control program that necessitates the highest reaction time possible. Does anyone what the fastest control statements would be using NQC (making the outputs react to sensor values as fast as possible)? i.e. Which (...) (24 years ago, 30-Mar-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: Yet another Q: IR messages
|
|
To send a message use the following: SendMessage(<variable> or <number>); The variable must be of integer type between 1 - 255 The number must be between 1 - 255 To read a message from the IR port do <variable> = Message(); This will put whatever (...) (24 years ago, 29-Mar-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: Yet another Q: IR messages
|
|
Hi Tobias, this could look something like this for example : int global_message; // place to store and read messages for every task task main() { start Read_Messages; // start Receive_Message Task while(true) { switch (global_message) { case 1 : (...) (24 years ago, 29-Mar-01, to lugnet.robotics.rcx.nqc)
|