View unanswered posts | View active topics It is currently Thu Sep 18, 2014 11:59 pm






Reply to topic  [ 7 posts ] 
multiple i2c sensors on one port 
Author Message
Rookie

Joined: Sat Apr 12, 2008 11:09 am
Posts: 49
Location: holland
Post multiple i2c sensors on one port
Hello

Is it possible to connect more than one i2c sensor on a single sensorport without using a port multiplexer?
they wil all need a different i2c adress i think, but are there more problems doing this?

Regards Gerrit


Sun Jun 15, 2008 3:07 pm
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
nxt wrote:
Is it possible to connect more than one i2c sensor on a single sensorport without using a port multiplexer?

yes :D
nxt wrote:
they wil all need a different i2c adress i think

yes :D
nxt wrote:
but are there more problems doing this?

no. :wink:

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sun Jun 15, 2008 4:41 pm
Profile
Rookie

Joined: Fri Apr 20, 2007 3:22 am
Posts: 36
Post 
You do have to be careful how you chain then together to make sure that the propper voltage is getting to each device.


Sun Jun 15, 2008 5:12 pm
Profile
Rookie

Joined: Sat Apr 12, 2008 11:09 am
Posts: 49
Location: holland
Post 
Hello,

Thanks for response.

How do you change the i2c adress of hitechnic sensors?


Tue Jun 17, 2008 4:14 pm
Profile
Rookie

Joined: Fri Apr 20, 2007 3:22 am
Posts: 36
Post 
Which ones? You may not need to.


Tue Jun 17, 2008 7:32 pm
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
the original Lego Sensors have fixed I²C addresses which can't be changed (always= 2 as far as I know). :(

The addresses of some Hitchnic or Mindsensors Sensors can be changed, here you have to refer to the manuals. :?

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Wed Jun 18, 2008 4:33 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
Hi NXT

Here is some code that may help you out. It is used to change the address of a mindsensor sensor, don't know if it will work on a hitechnic sensor, I think it will, excluding the sensors that come in the nxt kit.

http://www.freewebs.com/robotprojects/I2C%20Address%20Changer.c

all you need to do to use it is to change the last line of code and set the port of the sensor.
Change_add(Current Address , New Address);
Example code:
Change_add(0x02,0xA2);
This will change the sensors address from 0x02 to 0xA2

After that I suggest using this program to scan the port to make sure the address got changed. Make sure you sect the correct port to scan in the code.

http://www.freewebs.com/robotprojects/I2C%20Explorer.c

Good luck, hope this will help B-)

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Wed Jun 18, 2008 3:38 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.