Go to Post People are human, refs are human. The refs did the best they could do at the time. - Andy Baker [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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: 81
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

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
 


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 19:59.

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