To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2988
2987  |  2989
Subject: 
Re: Polling sensor values with wait_event
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 28 Nov 2002 00:50:05 GMT
Viewed: 
3531 times
  
Thomas,

I had a thought about this situation.  You could write a function that sets
a flag when the event is triggered, do nothing otherwise.  You could call
this function from within each of the tasks you write (at a somewhat high
frequency ... say every 20 or so lines of code).  Then the task responsible
for responding to the event could read and reset the flag.  Now, if you need
to know how many times it was triggered, or for how long it was triggered,
then it gets a little more complicated.  However, this would definitely
increase the applications ability to catch those quick events.

Don't forget to put tasks to sleep if/when possible.  This yields the
remainder of the time-slice to other tasks.

// Joe

"Thomas Gysi" <t.gysi@fh-aargau.ch> wrote in message
news:3DE4E44E.70701@fh-aargau.ch...
Hi Joe,

Thanks for your reply, I guess that is the solution to use in this case.
  I'll still just get values every 20ms. By changing the timeslice I
could have this go a bit faster though.

Thomas




Message is in Reply To:
  Re: Polling sensor values with wait_event
 
Hi Joe, Thanks for your reply, I guess that is the solution to use in this case. I'll still just get values every 20ms. By changing the timeslice I could have this go a bit faster though. Thomas (22 years ago, 27-Nov-02, to lugnet.robotics.rcx.legos)

4 Messages in This Thread:

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

Custom Search

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