| | Re: Drive types Philippe Hurbain
|
| | (...) Hello John, Could you comment a little the use of Precedes/Follows for task switching? I have trouble figuring when to use one or the other (or both?) Thanks in advance, Philo (18 years ago, 9-Jan-07, to lugnet.robotics)
|
| | |
| | | | Re: Drive types John Hansen
|
| | | | (...) Here is a simple multi-threaded NQC program: task music() { while (true) { PlayTone(262,40); Wait(50); PlayTone(294,40); Wait(50); PlayTone(330,40); Wait(50); PlayTone(294,40); Wait(50); } } task main() { start music; while(true) { (...) (18 years ago, 9-Jan-07, to lugnet.robotics)
|
| | | | |
| | | | | | Re: Drive types John Hansen
|
| | | | | (...) Whoops. The duration values in each of the PlayTone calls should be 400 rather than 40. John Hansen (18 years ago, 9-Jan-07, to lugnet.robotics)
|
| | | | | |
| | | | | | Re: Drive types Philippe Hurbain
|
| | | | | (...) Thanks John - quite clear now. Though I still don't understand why there are 2 different opcodes that can be used for more or less the same thing??? Philo (18 years ago, 9-Jan-07, to lugnet.robotics)
|
| | | | | |
| | | | | | | Re: Drive types John Hansen
|
| | | | | | (...) The presence of both opcodes comes from the early days of NBC when I was trying to understand the executable file format (before the days of documentation) and I knew that in the NXT-G compiler a clump had both upstream and downstream (...) (18 years ago, 9-Jan-07, to lugnet.robotics)
|
| | | | | | |
| | | | | | Re: Drive types Tim Byrne
|
| | | | (...) Besides Precedes and Follows, are there other ways to start additional threads? Specifically, I'd like to start additional threads and then continue the execution of the current thread. I might be misinterpreting this, but it seems that (...) (18 years ago, 13-Jan-07, to lugnet.robotics)
|
| | | | |
| | | | | | Re: Drive types Ross Crawford
|
| | | | (...) The problem is that the standard firmware doesn't support starting and stopping of threads AFAIK. But you can start multiple threads by putting precedes thread1, thread2 in your main thread, when it exits both threads will start getting time (...) (18 years ago, 13-Jan-07, to lugnet.robotics)
|
| | | | |
| | | | | | Re: Drive types John Hansen
|
| | | | (...) Rosco is correct. The standard NXT firmware uses a completely different execution model than the old RCX firmware uses. The NXT firmware does not provide any mechanism at all for starting and stopping threads. The only mechanism is to define (...) (18 years ago, 14-Jan-07, to lugnet.robotics)
|
| | | | |