NXT Sensor Multiplexer Java Libraries

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

NXT Sensor Multiplexer Java Libraries

Postby lusvelt » Sat Mar 22, 2014 2:32 pm

Hi,
I'm programming my LEGO NXT robot with java. I need to put more than four sensors an I was thinking about the idea to use a multiplexer. But when I go to the lejos API documentation I don't find any class that corresponds to the Sensor multiplexer. I searched in the package lejos.nxt.addon but I didn't found nothing. I absolutely want to use java, so I'm asking you what type of multiplexer should I have to buy and what package and class do I have to import in the program. I also searched on this forum but I didn't find nothing useful. Thank you.
lusvelt
New User
 
Posts: 3
Joined: Sat Mar 22, 2014 12:26 pm

Re: NXT Sensor Multiplexer Java Libraries

Postby gloomyandy » Sat Mar 22, 2014 4:34 pm

What sensor do you want to use? Which sensor multiplexer are you considering using?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NXT Sensor Multiplexer Java Libraries

Postby lusvelt » Sat Mar 22, 2014 7:10 pm

I want to use 2 UltrasonicSensor, 2 LightSensor and 1 colorSensor. So I will put three sensors on the NXT SensorPort and two sensors on the multiplexer
lusvelt
New User
 
Posts: 3
Joined: Sat Mar 22, 2014 12:26 pm

Re: NXT Sensor Multiplexer Java Libraries

Postby gloomyandy » Sat Mar 22, 2014 7:48 pm

And what multiplexer do you intend to use to do that?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NXT Sensor Multiplexer Java Libraries

Postby lusvelt » Sun Mar 23, 2014 8:19 am

Well, I'd use the HiTechnic Sensor Multiplexer http://www.hitechnic.com/cgi-bin/commer ... ey=NSX2020
lusvelt
New User
 
Posts: 3
Joined: Sat Mar 22, 2014 12:26 pm

Re: NXT Sensor Multiplexer Java Libraries

Postby gloomyandy » Sun Mar 23, 2014 10:13 am

In which case is there a reason you can't use this class:
http://www.lejos.org/nxt/nxj/api/index.html
Which I think is for the HiTechnics device. However I am not 100% sure as there are several sensor mux devices available and this driver was not provided by the core leJOS team. Before committing yourself to buying a mux (unless you have it already), make sure this is the driver for it.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NXT Sensor Multiplexer Java Libraries

Postby skoehler » Sun Mar 23, 2014 11:28 am

Andy, you mean the SensorMux class?
skoehler
leJOS Team Member
 
Posts: 1431
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXT Sensor Multiplexer Java Libraries

Postby skoehler » Sun Mar 23, 2014 11:43 am

The leJOS SensorMux class doesn't seem to support all features of the HiTechnic SensorMux. The RobotC driver suite for example supports reading from the various I2C buffers of the mux. See the HTSMUXreadPort function in https://github.com/botbench/rdpartyrobo ... ensormux.h . There is no method in our SensorMux class to do the same.

I must say, it is hard to find out which sensor mux the driver is for. The JavaDoc doesn't state it. At least at some point, 3dgamer's class was called HTSensorMux.
skoehler
leJOS Team Member
 
Posts: 1431
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXT Sensor Multiplexer Java Libraries

Postby gloomyandy » Sun Mar 23, 2014 9:46 pm

Sorry I forgot about the problem with links to frames and JavaDoc
http://www.lejos.org/nxt/nxj/api/lejos/ ... orMux.html

I'm pretty sure it is for the HighTechnics device (looking at the register usage). I agree that it is not complete, but it looks like it can probably handle two Ultrasonic sensors, which is probably good enough for what the original poster needs.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff