To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 972
971  |  973
Subject: 
Re: Q: Multitasking, and reacting to sensors
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 6 Feb 2001 20:55:22 GMT
Viewed: 
2045 times
  
"Rainer Balzerowski" <balze2@gmx.net> writes:

In lugnet.robotics.rcx.nqc, Juergen Stuber writes:

Can I define a task in the beginning of the program, then run it only
under certain circumstances (like light reading <50),

No, it runs all the time (in RCX2 there are events that can
do this, but they are more complicated to use).
You just need to use a loop to wait for the circumstances,
then do what you want to do.

or at a certain point in the program?

This is what function or subroutines are good for.

Sorry Juergen, but that's not quite right.
You can start and stop tasks as often as you wish to do.

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 subroutine/function.

Jürgen

--
Jürgen Stuber <stuber@loria.fr>
http://www.loria.fr/~stuber/



Message has 1 Reply:
  Re: Q: Multitasking, and reacting to sensors
 
(...) I agree with you here ! no question. Rainer (24 years ago, 7-Feb-01, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  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)

9 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR