Page 1 of 1

lego colour sensor (not HiTechnic)

PostPosted: Wed May 25, 2011 5:35 pm
by nemnem ... sensor.jpg

I got everything working except for the color sensor so I was wondering if any of you could help?
before this post I searched on google and AForge and tried the "NXT Test" program and ofcause I tried coding it my self but I give up
so this post is my last try for the sensor before my exam

since im here anyways I would like to thank everyone who has helped making the Framework it has allowed my school to start a new project for C# programming which is more fun than everything in school combined

Re: lego colour sensor (not HiTechnic)

PostPosted: Thu May 26, 2011 3:05 pm
by linusa
The LEGO NXT 2.0 color sensor is a bit complicated to access, there was confusion how it's possible via remote commands for some time. I compiled some of the available documentation here: . Unfortunately, some old links to the NXTasy forums are gone. You can still ask the mindboards community here:

But if you just want to port a working MATLAB version, see here: ... XT2Color.m ... XT2Color.m

If you don't have MATLAB, get an editor with syntax highlighting, such as Notepad++. You could also look at the nxt-python project to see how they do it...

Best regards, Linus Atorf

Re: lego colour sensor (not HiTechnic)

PostPosted: Thu May 26, 2011 3:16 pm
by linusa
I just remembered: There are working examples etc. included in NXC. Look at the NXC API in general ( ... index.html ) or some specific sensor constants (e.g. ... tants.html ). This is where to get some of the "new sensor modes" for the LEGO NXT 2.0 Color sensor. You also need Firmware 1.28 or better. It might also help to inspect the actual sourcode of NXC / the NBC compiler / BricxCC (all one package, look for it). Then you can take this function, for example: ... e59f0c19ab , and see the actual sourcecode (NBC) for the compiler, and see what is done internally...

Re: lego colour sensor (not HiTechnic)

PostPosted: Sat Sep 10, 2011 3:32 am
by piash006
he HiTechnic Color Sensor is “tuned” to standard LEGO colors. ... The Color Sensor V2 works best when it is positioned so that it is not too close to the surface :P