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 / 3755
3754  |  3756
Subject: 
Re: table brickos light to percent
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 27 May 2004 18:54:47 GMT
Viewed: 
5378 times
  
In my opinion, the best way to approach this is the following:

When the program starts, begin a Calibration, by first activating the
light sensor, then reading the value.  You can either wait a specific
amount of time or have the user press a button to continue.

During the calibration, you can measure and record the lowest and
highest light sensor readings.  Then for the duration of the program use
the following calculation:

percent = (current - lowest) / (highest - lowest);

At the exit of the calibration routine, you may want to ensure that
highest != lowest to be safe.

Also, during normal operation, you could always update the lowest and
highest if the current is lower or higher respectively.

For an adaptive process, you could have the high and low decay toward
each other over a period of a few minutes.  Then adjust the high and low
if the current exceeds the their values.  This way, the program could
adapt to changes in input conditions (for instance, on a partly cloudy
day, sometimes the sun will be shining, others it will not)

I hope this is helpful.
// Joe
(to answer your question more directly, no, I don't think there is a
table built into BrickOS that will do what you asked)


Thomas Jollans wrote:

i there a table or converter from brickos light readings to light
percentage ( and vice versa )

Thomas



Message is in Reply To:
  table brickos light to percent
 
i there a table or converter from brickos light readings to light percentage ( and vice versa ) Thomas (20 years ago, 27-May-04, to lugnet.robotics.rcx.legos)

3 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