Subject:
|
Re: light sensor LED control
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Sat, 5 Aug 2000 00:07:50 GMT
|
Viewed:
|
2024 times
|
| |
| |
In article <FyqyuJ.HpI@lugnet.com>, "Scott Minneman"
<minneman@parc.xerox.com> wrote:
> I'm using NQC 2.2 (but I also had the problem with 2.1) to compile
> programs for
> my RCX. I don't see how to control whether the LED in the light sensor
> is on
> or off. Doing a SetSensor didn't do it...I had to run an old program
> from
> Gordon's Brick Programmer to get it turned on (and now it stays on until
> I next
> download new firmware or get careless when I change batteries). I'm sure
> this
> has been covered before, but a search didn't turn up any messages that
> spelled
> it out.
The LED is on whenever you configure the sensor port to be an "active"
port (ROTATION or LIGHT sensor type). You can turn off the LED by
setting the port's type to one of the passive types (TOUCH,
TEMPERATURE). Actually, you can get reasonable results reading ambient
light levels like this:
SetSensorType(SENSOR_1, SENSOR_TYPE_TOUCH); // make it passive
SetSensorMode(SENSOR_1, SENSOR_MODE_RAW); // raw mode, values 0-1023
The sensor settings are "sticky"...they remain in effect even after a
program finishes running.
Dave Baum
--
reply to: dbaum at enteract dot com
|
|
Message is in Reply To:
| | light sensor LED control
|
| I'm using NQC 2.2 (but I also had the problem with 2.1) to compile programs for my RCX. I don't see how to control whether the LED in the light sensor is on or off. Doing a SetSensor didn't do it...I had to run an old program from Gordon's Brick (...) (24 years ago, 4-Aug-00, to lugnet.robotics.rcx.nqc)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|