I2C Sensor Question

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: roger, imaqine, 99jonathan

Xpyd3r
Novice
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

I2C Sensor Question

Postby Xpyd3r » Mon Aug 13, 2007 6:36 pm

Okay Lets say I wanted to have 2 sonar sensors on my NXT, would they both have to be plugged into the first port? My friend told me sonar only works on the first port, and if thats true, then you're only supposed to have one I2C sensor. But with I2C they have a send and recieve address, so theoretically couldnt I have two sonar on the first port and it would still communicate normally, i would just have to have a way to communicate which sonar I wanted, through the start byte (address byte)
any ideas?

User avatar
CoBB
Novice
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm

Postby CoBB » Mon Aug 13, 2007 7:43 pm

I2C sensors work in all but port 4. On the other hand, I think two ultrasonic sensors might interfere with each other.

Xpyd3r
Novice
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby Xpyd3r » Tue Aug 14, 2007 8:18 pm

What about 4 I2C sensors just out of curiosity? would I need to parallel attach the two I2Cs to a single port or what

User avatar
bbagnall
Site Admin
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby bbagnall » Mon Sep 03, 2007 4:52 pm

Theoretically you can plug an I2C sensor into each port, so no paralleling needed (the NXT has 4 ports). But currently NXJ doesn't support an I2C sensor in port 4 due to a bug. We'll fix that eventually.

takashic
Novice
Posts: 32
Joined: Mon May 21, 2007 2:22 am

Postby takashic » Thu Oct 25, 2007 11:36 pm

I downloaded the latest i2c related source code from trunk and confirmed
that the new i2c code fixed the port 4 issue. I tested Ultrasonic Sensor
and HiTechnic Acceleration Sensor.

Thank you for your great work!

Xpyd3r
Novice
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby Xpyd3r » Wed Nov 28, 2007 1:28 am

Where did you find that code Takashic? And do i just replace or add the new code to the libraries I already have?

takashic
Novice
Posts: 32
Joined: Mon May 21, 2007 2:22 am

Postby takashic » Thu Nov 29, 2007 12:49 pm

Where did you find that code Takashic? And do i just replace or add the new code to the libraries I already have?

leJOS NXJ development team stores all code under development into Subversion code repository (called trunk) at the download site. So anybody can see and download their great on-going work. But, these code are not offcially released yet, so it might not be tested well and I would not recommend to replace the released code to the new code under development. I tested it totally with my own risk.

takashic

Xpyd3r
Novice
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby Xpyd3r » Thu Dec 13, 2007 3:49 pm

Any idea when the new code will be released? because if its not in a month or two I'm going to have to work with that instead because I need the 4th port within the next few months

User avatar
bbagnall
Site Admin
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby bbagnall » Tue Dec 25, 2007 4:42 pm

Xpyd3r wrote:Any idea when the new code will be released? because if its not in a month or two I'm going to have to work with that instead because I need the 4th port within the next few months

If you use Windows you can find the current build in the snapshot directory here:
http://lejos.svn.sourceforge.net/viewvc ... /snapshot/

Download everything you see in there and put them in the proper directories (i.e. replace every file in your current download with these ones). Then you'll need to reflash your firmware with this version.

Xpyd3r
Novice
Posts: 50
Joined: Tue Aug 07, 2007 5:58 am

Postby Xpyd3r » Wed Dec 26, 2007 5:45 am

okay well I'm using linux so essentially i replace the classes and then what? do i have to modify the build to include classes that werent previously there or is there more to it before i reflash? Sorry, i'm very new to this but i'm going to have to go head first into playing around with this code, but i'd like to have a pretty good idea of what im trying to do before i mess anything up :-) and tips or advice would be great, Please and thanks :-)

lawrie
leJOS Team Member
Posts: 958
Joined: Mon Feb 05, 2007 1:27 pm

Postby lawrie » Thu Dec 27, 2007 9:11 am

I believe the snapshot should work on Linux by just replacing your jar files with the .jar files in snapshot/lib, and lejos_nxt_rom.bin and StartUpText.bin from snapshot/bin. You sould then reflash. You should not need to do the Linux ant build again as it just builds nxjflash and the .so shared library files and your current ones should still work.


Return to “NXJ Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest

cron