| | Re: Q: Multitasking, and reacting to sensors
|
|
(...) Ok, I have to admit that I was wrong. But I think most of the time it is the easiest solution to start all the tasks at the beginning and have them run in parallel. And if you want to perform some single action within a task use a (...) (24 years ago, 6-Feb-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: Q: Multitasking, and reacting to sensors
|
|
Thanks for the replies, and for the sample programs. I'll try them out soon. I'm building a robotic arm (that's why I chose to reply to this message, not the other, later ones) that I plan to program in NQC. It does not need multitasking to work, or (...) (24 years ago, 6-Feb-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: Q: Multitasking, and reacting to sensors
|
|
(...) Sorry Juergen, but that's not quite right. You can start and stop tasks as often as you wish to do. like this int do_s_s = 0; int condition = 0; task main() { while (1) { if (condition && !do_s_s) { start do_something_special; do_s_s = 1; } if (...) (24 years ago, 6-Feb-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: Q: Multitasking, and reacting to sensors
|
|
Hej Tobias! (...) No, rather you need a While or Until loop. Normal programming languages are different from the RCX code. In RCX code the watchers are running all the time, in NQC you need to program the repetition yourself. A program for simple (...) (24 years ago, 6-Feb-01, to lugnet.robotics.rcx.nqc)
|
|
| | Re: advice for game of tag?
|
|
(...) The firmware knows what (and when) it has just sent, so it can distinguish between incoming and outcoming messages. (...) That's not exactly true. Infrared light travels at the speed of light (300000 km/s), so you can safely ignore delays. (...) (24 years ago, 5-Feb-01, to lugnet.robotics.rcx.nqc)
|