The Lego color sensor does not use i2c, nor as far as I know is there any data sheet available. It is a rather odd sensor using a combination of a bit banged serial protocol on the digital I/O lines and being the only sensor I know of that uses the AT91 A/D input to allow high speed reading of the analogue input... I implemented the leJOS support based on the code in the Lego firmware, so you could always take a look at that. The source for the leJOS code is here (sorry it is a little complex due to the way we had to bury it as part of a the sensor port class to allow remote access, via LCP to it)....
http://lejos.svn.sourceforge.net/viewvc ... iew=markup
The code you are interested in starts around line 200 and is the ColorSensorClass...
Users browsing this forum: No registered users and 2 guests