Subject:
|
Re: table brickos light to percent
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 27 May 2004 18:47:56 GMT
|
Viewed:
|
5293 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
In lugnet.robotics.rcx.legos, Thomas Jollans wrote:
> i there a table or converter from brickos light readings to light
> percentage ( and vice versa )
Hi Thomas,
Here's the formula used in the dsensor.h include file:
#define ds_scale(x) ((unsigned int)(x)>>6) //!< mask off bottom 6 bits
#define LIGHT(a) (147 - ds_scale(a)/7) //!< map light sensor to 0..LIGHT_MAX
This maps the raw sensor value (range 0x0000 to 0xFFC0) to the
percentage.
Mark
|
|
Message is in Reply To:
3 Messages in This Thread: ![table brickos light to percent -Thomas Jollans (27-May-04 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/246.gif) ![You are here](/news/here.gif)
![](/news/x.gif) ![](/news/68.gif) ![Re: table brickos light to percent -Joseph Woolley (27-May-04 to lugnet.robotics.rcx.legos)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|