Subject:
|
Re: light sensor problem?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Mon, 24 Jul 2000 00:04:22 GMT
|
Viewed:
|
2319 times
|
| |
| |
> Having fixed the other screwup, I can report that snipping the code I
> discussed earlier allows everything to build just fine. It doesn't,
> however, solve the issue with the light sensors.
I'm the one that fixed active sensor reading... :-) Settle time is one of
mine... Kekoa msg about this problem (a very old one in this ng if I
remember) helped me to solve things.
> That didn't help either, at least not a whole lot. So... maybe the problem
> isn't in ds_handler(), but I can't figure out where else it could be.
> Anyone? Or does everyone else just not care that the scaling is screwed
> up?
I patched the reading routine in ds_handler to fix a vary bad behavier that
caused reading for active sensors to be quite random without a small
delay... Now with the settle time the reading is stable, but also changed in
values for different offsets... I've fixed rotation sensor values, but...
I've not fixed the scaling factor, because I can't figure why Markus used
these lines to define upper and lower limits for raw readings... I've also
asked for it but I got no reply as usual nowadays...
Please, feel free to change, or investigate these values to fix light
reading...
Here is the snip from dsensor.h.
//
// active light sensor: estimated raw values
//
#define LIGHT_RAW_BLACK 0xeb00 //!< active light sensor raw black value
#define LIGHT_RAW_WHITE 0xba00 //!< active light sensor raw white value
//
// convert raw values to 0 (dark) .. LIGHT_MAX (bright)
// roughly 0-100.
//
#define LIGHT(a) ((LIGHT_RAW_BLACK - (unsigned int)(a))>>7)
//!< map light sensor to 0..LIGHT_MAX
#define LIGHT_MAX LIGHT(LIGHT_RAW_WHITE)
//!< maximum decoded value
Bye,
Paolo.
---
Shaw's Principle: Build a system that even a fool can use, and only a
fool will want to use it.
|
|
Message has 2 Replies: | | Re: light sensor problem?
|
| (...) To achive scaling of light sensor reading from 0..100 the following theoretical formula should be used: light = 146 - scaled / 7, where scaled is the reading of AD_X >> 6. I found this at (URL) this page contains a lot of electrical (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
| | | Re: light sensor problem?
|
| (...) Oh! So readings are more stable, and it isn't just my imagination. That's good to know :) (...) Those values used to pretty cleanly define max and min- or at least, they must have, since I consistently got 15-105 values (or roughly what he (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: light sensor problem?
|
| (...) Having fixed the other screwup, I can report that snipping the code I discussed earlier allows everything to build just fine. It doesn't, however, solve the issue with the light sensors. I also tried swapping the two lines I mentioned earlier: (...) (24 years ago, 23-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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|