NXT Color Sensor
2 posters
Page 1 of 1
NXT Color Sensor
Hi, i m new to NXT and mindsquall.
First of all, thanks very much for such a great library saving me plenty time study Lego spec.
I have a small question about color sensor, is there any way to turn on the white LED light source? i check the NxtColorSensor class but cant found any.
Thanks!
First of all, thanks very much for such a great library saving me plenty time study Lego spec.
I have a small question about color sensor, is there any way to turn on the white LED light source? i check the NxtColorSensor class but cant found any.
Thanks!
alan- Posts : 2
Join date : 2011-09-15
Re: NXT Color Sensor
The NXT2 color sensor does not have a white led. Instead it has a hole with three colored leds behind: red, green and blue (and a lens before them). You can turn them on one at a time, or all tree at the same time. The last option should in theory give a whitish light, but looks more like three overlapping colored circles.
The sensor has two modes – it can function as a color sensor or it can function as a light sensor.
In the color sensor mode, all the three leds are turned on. And so to answer to your question, set it into this mode and ignore the sensor-part:
I agree that this is not very intuitively when you just want to use the sensor as a lamp. I think that I will add some extra methods for this in the next version.
The sensor has two modes – it can function as a color sensor or it can function as a light sensor.
In the color sensor mode, all the three leds are turned on. And so to answer to your question, set it into this mode and ignore the sensor-part:
- Code:
NxtBrick brick = new NxtBrick(NxtCommLinkType.Bluetooth, 3);
Nxt2ColorSensor sensor = new Nxt2ColorSensor();
brick.Sensor1 = sensor;
sensor.SetColorDetectorMode();
brick.Connect();
- Code:
sensor.SetLightSensorMode(Nxt2Color.Black);
- Code:
sensor.SetLightSensorMode(Nxt2Color.Green);
I agree that this is not very intuitively when you just want to use the sensor as a lamp. I think that I will add some extra methods for this in the next version.
Niels- Posts : 19
Join date : 2011-07-15
Re: NXT Color Sensor
Thanks very much, it is helpful.
At first i was looking at the Color sensor, there are 3 led/sensor like component. Just wonder what they actually use for.
At first i was looking at the Color sensor, there are 3 led/sensor like component. Just wonder what they actually use for.
alan- Posts : 2
Join date : 2011-09-15
Re: NXT Color Sensor
Everything you didn't know you wanted to know about the NXT2 color sensor:
http://botbench.com/blog/2011/09/16/exposed-lego-colour-sensor/
http://botbench.com/blog/2011/09/16/exposed-lego-colour-sensor/
Niels- Posts : 19
Join date : 2011-07-15
Similar topics
» My sensor don't show zero en x-axis
» Example of how to use the NXT Acceleration / Tilt Sensor
» Sensor Events not working when using CONTROLLED_MOTORCMD
» Example of how to use the NXT Acceleration / Tilt Sensor
» Sensor Events not working when using CONTROLLED_MOTORCMD
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|