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 / 1271
1270  |  1272
Subject: 
RE: light sensor problem?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 24 Jul 2000 17:39:27 GMT
Viewed: 
1655 times
  
-----Original Message-----
From: news-gateway@lugnet.com [mailto:news-gateway@lugnet.com]On Behalf
Of Paolo Masetti
Sent: Monday, July 24, 2000 12:20 PM
To: lugnet.robotics.rcx.legos@lugnet.com
Subject: Re: light sensor problem?


I looked through the dsensor stuff, and it looks quite bad to me...

:-) It is not the best implementation I've seen... :-)

We execute a delay loop inside an interrupt handler.
We issue the command to start the next read from that same handler.

Yes. I hate the delay loop but we I can't imagine how to do it better if we still need maximum speed in reading values
from sensors. The routine also change his sampling speed if we need a reading for 1, 2 or 3 sensors and if we need to
handle a rotation sensor too... This is a price to pay for a total IRQ handling of ADC & sensors... :-(((

I've used the OC1B interrupt for my servo driver code in pbForth. You could
use the OC1B to set the settle time for each reading, and then actually read
the results when the interrupt expires. Having a structure to tell you which
A/D to read etc would be nice....

I don't know too much about legOS, but real-time execs are my specialty
in my regular job. Whenever I have to get info from a hardware driver,
I usually start the sample process and put the task to sleep until
the driver tells me that sample is available. The task waiting on the
sample shouldn't have anything to do until the sample is ready anyways...

Cheers,

Ralph Hempel - P.Eng

--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbFORTH>
--------------------------------------------------------
Reply to:      rhempel at bmts dot com
--------------------------------------------------------



Message is in Reply To:
  Re: light sensor problem?
 
(...) :-) It is not the best implementation I've seen... :-) (...) Yes. I hate the delay loop but we I can't imagine how to do it better if we still need maximum speed in reading values from sensors. The routine also change his sampling speed if we (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)

26 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