Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Sensors (http://www.chiefdelphi.com/forums/forumdisplay.php?f=173)
-   -   Using the NXT Light Sensor. (http://www.chiefdelphi.com/forums/showthread.php?t=89452)

Techwiz 18-01-2011 08:46

Using the NXT Light Sensor.
 
Does anyone know how to get data from NXT sensors VIA I2C?

We hooked a light sensor to the I2C port on the Digital Side Car, and the red LED illuminated.

In Java:
Code:

byte[] byte1 = new byte[100];
ls.read(0, 7,  byte1);


for(int i= 0; i < 100; i++)
System.out.println(byte1[i]);

Note: Ls is defined as an I2C in the Constructor:
Code:

four = new DigitalModule(4);
ls=new I2C(four,0);

Thanks,

Bot190 18-01-2011 09:06

Re: Using the NXT Light Sensor.
 
The Short answer is, You can't.
The Long answer: The NXT Light sensor doesn't use I2C to communicate. The only sensor that does, is the ultrasonic sensor. If you really wanted to use the light sensor, you should be able to hook it up to the analog Module.

Techwiz 18-01-2011 09:23

Re: Using the NXT Light Sensor.
 
Do you know where we can get a pinout, for the sensors?

and or directions to hook it up to the analog module.

Bot190 18-01-2011 10:14

Re: Using the NXT Light Sensor.
 
The documentation for The NXT brick, and the sensors is available from http://mindstorms.lego.com/en-us/sup...s/default.aspx under the hardware development kit. You should be able to figure out the pinout from those documents.


All times are GMT -5. The time now is 07:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi