Subject:
|
Re: light sensor question
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Thu, 24 Jul 2003 14:09:31 GMT
|
Viewed:
|
3204 times
|
| |
| |
Aaron Goodman <lone(underscore]iguana@hotmail[do.t]com> writes:
>
> The Analog to Digital converter of the h8/300 (the brains
> of the lego mindstorms) is 10 bits, so it has a range of
> 0-1023. I'm not sure how it converts that to the 0-100, it
> may do it by just dividing by 10 and rounding.
According to Kekoa Proudfoot's RCX Internals webpage
(http://graphics.stanford.edu/~kekoa/rcx/):
if (raw < 187) // bug? this allows percent=101, should be raw < 189
sensor->value = 64
else
sensor->value = (3ff - raw) * 19 / 9c
Numbers are in hexadecimal (base 16).
Jürgen
--
Jürgen Stuber <stuber@loria.fr>
http://www.loria.fr/~stuber/
> rot 13 "fr"
"se"
|
|
Message is in Reply To:
| | Re: light sensor question
|
| (...) The Analog to Digital converter of the h8/300 (the brains of the lego mindstorms) is 10 bits, so it has a range of 0-1023. I'm not sure how it converts that to the 0-100, it may do it by just dividing by 10 and rounding. If you want to see (...) (21 years ago, 24-Jul-03, to lugnet.robotics.rcx)
|
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|