Infrared Link Supported?

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

Moderators: imaqine, 99jonathan, roger

Vash
New User
Posts: 17
Joined: Fri May 30, 2008 5:47 pm

Infrared Link Supported?

Postby Vash » Wed Jun 11, 2008 8:52 am

Has lejos added support for the HiTechic Infrared Link? I found a post from Feb 08 that mentions it does not have support yet. I also found a post from Nov 07 that says the support for the link is currently in the SVN and would be in the next release.

Did the support not make the 0.6 release? If not, is the support in the SVN?

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

Postby lawrie » Wed Jun 11, 2008 6:14 pm

What do you want to do with the IRLink?

The second post you referred to was talking about the RCXLink class that only supports the Mindsensors NR-Link, not the HiTechic IRLink.

However, there is now an IRLink class in SVN, but it currently only supports PF motors, not communication with the RCX.

Vash
New User
Posts: 17
Joined: Fri May 30, 2008 5:47 pm

Postby Vash » Wed Jun 11, 2008 7:49 pm

I wanted to just have the link send out infrared then use the infrared seeker to find the infrared sent out by the link. I'm not looking to actually send anything, just have the link send out infrared for the seeker to find.

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

Postby lawrie » Thu Jun 12, 2008 7:55 pm

If you use the IRLink class in SVN and use sendPFComboDirect to send a PF command, it should do what you want.

LasseD
New User
Posts: 4
Joined: Sat Jun 14, 2008 9:43 am

Postby LasseD » Sat Jun 14, 2008 9:54 am

The method for Combo direct mode from SVN works as it should, and I have added some additional methods in my own version for the other PWM modes
( http://www.daimi.au.dk/~ld/lego/NXT/IRLink.java - the package should be changed back to lejos.nxt)

The Single output PWM modes (sendPFSingleOutputPWM_A and B-methods) where you can control the speed of a motor is now implemented and tested. It works! :D

I have some problems with the Combo PWM mode.
The motors are controlled as they should, but ignore all PWM-commands ending with a 1-bit. I can't find any obvious flaws in the code (it is pretty straight forward), so I will have to look into the nitty gritty details of what is sent to the sensor.

Vash
New User
Posts: 17
Joined: Fri May 30, 2008 5:47 pm

Postby Vash » Mon Jun 16, 2008 1:15 am

I have downloaded the file and I am using sendPFComboDirect(0, 2, 3). The IRSeeker using getDirection() I have setup doesn't seem to be detecting the signal the IRLink is sending. I'm assuming its still not sending anything. Do I need to reflash the block with the files from the SVN to use IRLink?

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

Postby lawrie » Mon Jun 16, 2008 10:30 pm

I think the IRLink class will work with the NXJ 0.6 version. I don't think it relies on anything else in SVN. You will probably need to send the commands continuously in a loop. It drives PF motors for me see examples/PFTest.

Vash
New User
Posts: 17
Joined: Fri May 30, 2008 5:47 pm

Postby Vash » Mon Jun 16, 2008 10:56 pm

I have the it running it a loop.

Here is the code for the IRLink thread.

Code: Select all

IRLink link = new IRLink(SensorPort.S3);
while (!Button.ESCAPE.isPressed())
{
link.sendPFComboDirect(0, 2, 3);
}


Here is the code for the IRSeeker thread.

Code: Select all

IRSeeker seeker = new IRSeeker(SensorPort.S2);
while (true)
{
int direction = seeker.getDirection();
LCD.clear();
LCD.drawInt(direction, 2,2);
LCD.refresh();
}


I always get 0 for the direction.

LasseD
New User
Posts: 4
Joined: Sat Jun 14, 2008 9:43 am

Postby LasseD » Wed Jun 18, 2008 4:11 pm

Have you tested the IRSeeker using other light sources (such as a candle, the sun or a Wii-bar)?

I doubt the IRLink will be useful. It doesn't transmit all the time. I have seen people use IR-LEDs instead. You just have to be careful not to give them too much voltage (use a resistor and plug it into a sensor port set up as a RCX light sensor).

wleue
New User
Posts: 23
Joined: Tue May 15, 2007 8:55 pm
Location: Albany, NY
Contact:

HiTech IR Link to RCX

Postby wleue » Sun Oct 05, 2008 7:28 pm

Reading through the messages in this thread, it appears that Lejos 0.6 does not yet support IR communication to/from an RCX brick using the HiTech Infrared Link Sensor.

Am I correct? If so, what are the chances that there will be support in the next rev of Lejos, or some 'real soon now' version? I just bought the IR link, which does appear to talk to an RCX from the NXT when using the NXT-G IDE, but not with Lejos. The NXT-G system is really too limiting for what I need to do, but Lejos would fit the bill nicely, "if only...."

Thanks!
-Bill

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

Postby gloomyandy » Sun Oct 05, 2008 8:40 pm

Hi Bill,
Well the svn version has support for talking to the pfmotors, but as you say not to the RCX. I don't think any of the current dev team have one of these devices to work with. You could always try and add the code yourself. If you want to give it a try, I'm sure you would get some help....

Andy

wleue
New User
Posts: 23
Joined: Tue May 15, 2007 8:55 pm
Location: Albany, NY
Contact:

Postby wleue » Mon Oct 06, 2008 3:58 pm

Thanks for the vote of confidence :)

However, I thought this over, and I think I can make my application work with the PF commands only. I wonder if there is some documentation for the IRSeeker class? (Is this even the right class for the PF commands?) I didn't find anything in the API javadocs or much in the tutorial other than the table listing the class and that it is a subclass of the i2c class. The source code that is bundled with Lejos does not appear to have the source for IRSeeker either, although I may have missed it.

Does the command set for talking to a PF IR receiver through the IRSeeker class allow you to pick the channel (1-4) and the direction (forward, backward)? What about things like continuous command vs set and forget?

If IRSeeker really supports the full PF repetoire, this would be great, since in effect it gives up to 4 output channels and only burns one input channel. Granted, you don't get power levels and closed loop feedback, but for many simple needs, just on/off forward/reverse is quite adequate.

Thanks for listening to all the newbie questions!

-Bill

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

Postby gloomyandy » Mon Oct 06, 2008 4:36 pm

Hi,
Take a look at:
http://lejos.svn.sourceforge.net/viewvc/lejos/trunk/classes/lejos/nxt/addon/IRLink.java?view=markup

Not a lot to go on though! Unfortunately I know nothing at all about the pf stuff!

Andy

wleue
New User
Posts: 23
Joined: Tue May 15, 2007 8:55 pm
Location: Albany, NY
Contact:

Postby wleue » Mon Oct 06, 2008 5:15 pm

Super! That tells me what I need to know; thanks!

-Bill

wleue
New User
Posts: 23
Joined: Tue May 15, 2007 8:55 pm
Location: Albany, NY
Contact:

Postby wleue » Mon Oct 13, 2008 1:56 pm

I wrote a program to test the HiTech IR Sensor, based on the IRLink class in the NXJ addon packaage.

Unfortunately, the 'import lejos.nxt.addon.*;' statement fails because that package definition does not appear to exist in the standard Lejos 0.6 installation, and so I can't instantiate an IRLink object because its definition is unknown.

I looked in the Examples folder, but there is no sample code using the addon package that I could find.

So my questions are:
a) How do I add the 'addon' package to my Lejos 0.6 installation?
b) Is there some sample code that uses the IRLink class that I can get?

Thanks!
-Bill


Return to “NXJ Hardware”

Who is online

Users browsing this forum: No registered users and 2 guests