SetSensorColorNone? SetSensorColorFull?
SetSensorColorNone? SetSensorColorFull?
what exactly do
SetSensorColorNone?
NXT 2.0 color sensor (none) in percent mode
what is none sensor ?
what is no color in percent ????
how is the sensor value polled?
SetSensorColorFull?
NXT 2.0 color sensor (full) in raw mode
is this white color ?
active or passive ?
how is the sensor value polled?
which code works like the old light sensor in active mode and how in passive mode?
SetSensorColorNone?
NXT 2.0 color sensor (none) in percent mode
what is none sensor ?
what is no color in percent ????
how is the sensor value polled?
SetSensorColorFull?
NXT 2.0 color sensor (full) in raw mode
is this white color ?
active or passive ?
how is the sensor value polled?
which code works like the old light sensor in active mode and how in passive mode?
Re: SetSensorColorNone? SetSensorColorFull?
In other words, it turns off the light, which would make it a passive light sensor similar to the NXT 1.0 light sensor in passive (aka ambient light) mode. You read color sensor values in all of its modes via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.Configure an NXT 2.0 no light sensor.
Configure the sensor on the specified port as an NXT 2.0 color sensor in no light mode. Requires an NXT 2.0 compatible firmware.
In other words, it turns on all three lights (r, g, and b) so that the sensor is in "full color" mode. In this mode you can read color number values via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.Configure an NXT 2.0 full color sensor.
Configure the sensor on the specified port as an NXT 2.0 color sensor in full color mode. Requires an NXT 2.0 compatible firmware.
There are many threads here (iirc) that describe how to use the color sensor like the old NXT 1.0 light sensor in active mode. Generally, you call SetSensorColorRed(port) and then you read its value via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: SetSensorColorNone? SetSensorColorFull?
thank you very much!
Just a proposal:
what about calling the functions / constants
SensorColorPassive()
and
SensorColorLightActive()
?
about the forum's search:
the search function is too poor, mostly I get "words in your search query were ignored because they are too common words" or "No posts were found because the word is not contained in any post."
Just a proposal:
what about calling the functions / constants
SensorColorPassive()
and
SensorColorLightActive()
?
about the forum's search:
the search function is too poor, mostly I get "words in your search query were ignored because they are too common words" or "No posts were found because the word is not contained in any post."
Re: SetSensorColorNone? SetSensorColorFull?
ps:
as I just observed right now:
can't I have SetSensorColorNone also in raw values?
as I just observed right now:
SetSensorColorNone is in percent, but SetSensorColorFull is in raw.SetSensorColorNone
//NXT 2.0 color sensor (none) in percent mode
SetSensorColorFull
// NXT 2.0 color sensor (full) in raw mode
can't I have SetSensorColorNone also in raw values?
Re: SetSensorColorNone? SetSensorColorFull?
and still another question:
what I want a raw values (0...1024) for the light-passive-mode and also for the light-active-mode just like the light sensor,
I don't want color numbers in light-active-mode!
Just raw values (0...1024) for brightness over all, color-independent, as well as for active ("white"-illuminated) and for passive (ambient) reading.
what I want a raw values (0...1024) for the light-passive-mode and also for the light-active-mode just like the light sensor,
I don't want color numbers in light-active-mode!
Just raw values (0...1024) for brightness over all, color-independent, as well as for active ("white"-illuminated) and for passive (ambient) reading.
Re: SetSensorColorNone? SetSensorColorFull?
If you want raw values you can easily configure the color sensor to use raw mode or you can use SensorValueRaw. We have had this conversation before about how to get raw values from sensors.
To use the new color sensor like the old light sensor (why not just use the old light sensor?) you use SetSensorColorRed if you don't mind the sensor being configured in percent (i.e., scaled) mode.
Then you google "NXC API" and click on the first link. Then you drill down into Modules, then NXT Firmware Modules, then Input module. After that you dig around and read what the help has to say about sensor types and modes. It's all there in black and white (or black, blue and white). As we have discussed before the high level sensor configuration routines pick a type and a mode for you and then reset the sensor. If you need something different from what these high level functions do you simply set the type, set the mode, and reset the sensor. I.e., SetSensorType, SetSensorMode, ResetSensor. The first two API functions listed when you click on Input module functions in the tree will be SetSensorType and SetSensorMode. If you open the help for these functions there will be a link to all the sensor type constants and the sensor mode constants.
You never ever use the color sensor with its type set to full color if you want it to act anything like the original NXT light sensor. You have to use None, Red, Green, or Blue. Red is best for producing similar (not identical) results to the original light sensor in active mode.
I'm not going to rename my API functions.
P.S. where did you get the quoted text which does not match the API help description of these API functions?
John Hansen
To use the new color sensor like the old light sensor (why not just use the old light sensor?) you use SetSensorColorRed if you don't mind the sensor being configured in percent (i.e., scaled) mode.
Then you google "NXC API" and click on the first link. Then you drill down into Modules, then NXT Firmware Modules, then Input module. After that you dig around and read what the help has to say about sensor types and modes. It's all there in black and white (or black, blue and white). As we have discussed before the high level sensor configuration routines pick a type and a mode for you and then reset the sensor. If you need something different from what these high level functions do you simply set the type, set the mode, and reset the sensor. I.e., SetSensorType, SetSensorMode, ResetSensor. The first two API functions listed when you click on Input module functions in the tree will be SetSensorType and SetSensorMode. If you open the help for these functions there will be a link to all the sensor type constants and the sensor mode constants.
You never ever use the color sensor with its type set to full color if you want it to act anything like the original NXT light sensor. You have to use None, Red, Green, or Blue. Red is best for producing similar (not identical) results to the original light sensor in active mode.
I'm not going to rename my API functions.
P.S. where did you get the quoted text which does not match the API help description of these API functions?
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: SetSensorColorNone? SetSensorColorFull?
ok, that is the answer to the "Light-Active" mode of the Lego Color Sensor I was asking and searching for.You never ever use the color sensor with its type set to full color if you want it to act anything like the original NXT light sensor. You have to use None, Red, Green, or Blue. Red is best for producing similar (not identical) results to the original light sensor in active mode.
The old Light Sensor can't be used because
1) it's not for me personally and
2) the guy who was asking has got the 2.0 NXT set and probably wants to mimicri the 1.0 Light Sensor.
3) I hope he will understand your google-"NXC API"-and-so-on-instruction (I personally don't, but I don't own a Lego color sensor anyway, I only wanted to provide help)
I don't remember where I got the quoted lines from, I have been searching quite a long time in help files and in the web as well and this was the best what I found. When it's not from a help file (maybe an old one?) then it must be from somewhere else.
Re: SetSensorColorNone? SetSensorColorFull?
I answered your question about both passive and active light sensor emulation in my first reponse above, i.e., this post:
https://sourceforge.net/apps/phpbb/mind ... 282#p11797
Regarding SetSensorColorNone:
https://sourceforge.net/apps/phpbb/mind ... 282#p11797
Regarding SetSensorColorNone:
And later regarding how to emulate the active light sensor:In other words, it turns off the light, which would make it a passive light sensor similar to the NXT 1.0 light sensor in passive (aka ambient light) mode. You read color sensor values in all of its modes via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.
John HansenThere are many threads here (iirc) that describe how to use the color sensor like the old NXT 1.0 light sensor in active mode. Generally, you call SetSensorColorRed(port) and then you read its value via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: SetSensorColorNone? SetSensorColorFull?
well, yes, but -
It is unlogical that SetSensorColorRed, SetSensorColorBlue, SetSensorColorGreen cause the return of values of colored light intensity, and SetSensorColorNone causes the return of intensity values of reflected white ambient light ,
but SetSensorColorFull causes the return of no full light intensity values but of color identification code values.
To distinguish this behaviour from the others it would have been better to name it like SetSensorColorID
or even more logical and intuitive:
and the others:
what I understood was: turning on all three lights brings the sensor is in "full color" mode which I understood that it would return raw values which represent the brightness values (I didn't know what "you can read color number values" should mean instead as I don't own one - and the help file didn't explain that).Configure an NXT 2.0 full color sensor.
Configure the sensor on the specified port as an NXT 2.0 color sensor in full color mode. Requires an NXT 2.0 compatible firmware.
In other words, it turns on all three lights (r, g, and b) so that the sensor is in "full color" mode. In this mode you can read color number values via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.
in this case it appeared to me to be unlogic just to read red, I prefered to read all colors (white color) which is like "brightness" or "intensity of full (white) light".There are many threads here (iirc) that describe how to use the color sensor like the old NXT 1.0 light sensor in active mode. Generally, you call SetSensorColorRed(port) and then you read its value via the SensorValue(port), Sensor(port), or SENSOR_n (i.e., SENSOR_1..SENSOR_4) API functions.
It is unlogical that SetSensorColorRed, SetSensorColorBlue, SetSensorColorGreen cause the return of values of colored light intensity, and SetSensorColorNone causes the return of intensity values of reflected white ambient light ,
but SetSensorColorFull causes the return of no full light intensity values but of color identification code values.
To distinguish this behaviour from the others it would have been better to name it like SetSensorColorID
or even more logical and intuitive:
Code: Select all
SetSensor(port, SensorColor);
n=SensorValue(port, SensorColorID);
Code: Select all
SetSensor(port, SensorColor);
x=SensorValue(port, SensorColorRed);
x=SensorValue(port, SensorColorBlue);
x=SensorValue(port, SensorColorGreen);
x=SensorValue(port, SensorColorPassive);
Re: SetSensorColorNone? SetSensorColorFull?
To distinguish this behaviour from the others it would have been better to name it like SetSensorColorID
or even more logical and intuitive:
This thread is done. Stop asking.I'm not going to rename my API functions.
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Who is online
Users browsing this forum: No registered users and 2 guests