Programming the Lego Colour Sensor in NXC
Programming the Lego Colour Sensor in NXC
Can i program a color sensor in NXC? -answered-
(yes) What should i write?
(yes) What should i write?
Last edited by borntoown on 22 Nov 2010, 13:45, edited 2 times in total.
B2O productions are the best for the best.
Re: Programming the Lego Colour Sensor in NXC
Please use sensible subject lines when asking for something on the forums.
There are plenty of examples on these forums of using the colour sensor. I suggest you search for it a little bit.
- Xander
There are plenty of examples on these forums of using the colour sensor. I suggest you search for it a little bit.
- Xander
| 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)
Re: Programming the Lego Colour Sensor in NXC
Not a helpful subject line I agree, but I have to say I too have struggled to find any useful information on using NXC with the LEGO colour (color?) sensor on here.
Specifically, I'd like to know how to use it as a greyscale sensor.
Specifically, I'd like to know how to use it as a greyscale sensor.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Programming the Lego Colour Sensor in NXC
"Colour" and "color" are both proper ways to spell the word. "Color" is the American English way, and "colour" is the UK English way. I think it's the same with gray and grey.
What do you mean by "greyscale"? You want to read it as if it was a light sensor? Just set it up as "red", instead of "full", or just read the red raw value.
What do you mean by "greyscale"? You want to read it as if it was a light sensor? Just set it up as "red", instead of "full", or just read the red raw value.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Programming the Lego Colour Sensor in NXC
Well, I didnt get my help yet... :S
B2O productions are the best for the best.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Programming the Lego Colour Sensor in NXC
What do you mean you didn't get help? The answer is yes. What should you write? What do you mean by that?
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Programming the Lego Colour Sensor in NXC
The command i need to write?
B2O productions are the best for the best.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Programming the Lego Colour Sensor in NXC
Code: Select all
SetSensorColorFull(S1);
You can also use one of the following lines of code.
Code: Select all
SetSensorColorRed(S1);
SetSensorColorGreen(S1);
SetSensorColorBlue(S1);
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Programming the Lego Colour Sensor in NXC
The SetSensorColorFull gives an error "unidentified SetSensorColorFull". What to do?
B2O productions are the best for the best.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Programming the Lego Colour Sensor in NXC
Get the latest version of BCC.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Who is online
Users browsing this forum: No registered users and 4 guests