Go to Post There are a lot of great teams that impress me, but four that really stand out... Our team doesn't want to beat these teams, we want to be these teams. - Mark Holschuh [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-01-2011, 08:46
Techwiz's Avatar
Techwiz Techwiz is offline
Blake B
AKA: Blake
FRC #4909 (The Bionics)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2007
Location: Massachusetts
Posts: 86
Techwiz will become famous soon enough
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,
__________________
Blake
Electrical, Programming and Design

Creator FRC Q&A 2017
Mass FRC Team 4909: The Bionics
Maine FRC Team 5122: The RobOTies (2014-2015)
Maine FRC Team 2648: Infinite Loop (2008-2011)
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2011, 09:06
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
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.
__________________

Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2011, 09:23
Techwiz's Avatar
Techwiz Techwiz is offline
Blake B
AKA: Blake
FRC #4909 (The Bionics)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2007
Location: Massachusetts
Posts: 86
Techwiz will become famous soon enough
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.
__________________
Blake
Electrical, Programming and Design

Creator FRC Q&A 2017
Mass FRC Team 4909: The Bionics
Maine FRC Team 5122: The RobOTies (2014-2015)
Maine FRC Team 2648: Infinite Loop (2008-2011)
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2011, 10:14
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
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.
__________________

Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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