NXC: NXT 2.0 color sensor in lamp mode
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
NXC: NXT 2.0 color sensor in lamp mode
Hi.
I'm wondering if anyone knows how to turn on the light on the nxt 2.0 color sensor (not the HT sensor) in NXC?
Tim
I'm wondering if anyone knows how to turn on the light on the nxt 2.0 color sensor (not the HT sensor) in NXC?
Tim
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
I use the following to select mode, and therefore setting the LED control.
Code: Select all
SetSensorColorRed(S1); //Turn on Red
SetSensorColorGreen(S1);//Turn on Green
SetSensorColorBlue(S1); //Turn on Blue
SetSensorColorFull(S1); //Turn on all (multiplexed, so not at the same time, thus reducing brightness)
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
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
Thanks. I just didn't know that that did it
Thanks again
Tim.
Thanks again
Tim.
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
How do you turn them off?
Thanks
Tim
Thanks
Tim
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
NP. I can only assume, but try using the following to turn it off.
Code: Select all
SetSensorColorNone(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
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
Thanks.
-Tim
-Tim
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Re: NXC: NXT 2.0 color sensor in lamp mode
Does anyone know why the calls SetSensorColorFull( colorSensorPort ) and SetSensorColorNone( colorSensorPort ) each take about 170 milliseconds? It seems like a lot of time just to turn a light on and off. I didn't find any waits in the generated code so I assume that this happens in the firmware.
Re: NXC: NXT 2.0 color sensor in lamp mode
This is a firmware/hardware thing and a known issue with this sensor.
- Xander
- 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)
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: NXT 2.0 color sensor in lamp mode
You call it an "issue", is it messed up (not how it should be)? what is responsible for the delay? Is it the NXT firmware? the sensor? both? I don't like the delay, but if it is an NXT problem, could it be used that much faster with a u-processor as an NXT co-processor (Arduino, or PICAXE)?mightor wrote:This is a firmware/hardware thing and a known issue with this sensor.
- Xander
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: NXC: NXT 2.0 color sensor in lamp mode
I have no idea tbh. One way you could find out is to compare the time it takes with various firmwares Use an NXT 1.0 light sensor to measure, it's got a 3ms update time.
- Xander
- 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)
Who is online
Users browsing this forum: No registered users and 5 guests