IrSeeker

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

Moderators: 99jonathan, roger, imaqine

IrSeeker

Postby nikita190 » Mon Apr 09, 2012 8:29 pm

Hello ..
I have a problem with the IR sensor Seeker. I was working in Netbeans and I switch to eclipse.
And to get the ball with "seeker.getDirection ();" just read "-1"
And also tell me that "seeker.setAddress(0x8);" is not in use

Code: Select all
package com.mydomain;

import lejos.nxt.SensorPort;
import lejos.nxt.addon.CompassHTSensor;
import lejos.nxt.addon.IRSeeker;

public class HelloWorld
{
    /**
     * @param args
     */
   private static IRSeeker seeker;
   private static CompassHTSensor compas;
   

   @SuppressWarnings("deprecation")
   public static void main(String[] args)
    {
          seeker = new IRSeeker(SensorPort.S4);
          compas = new CompassHTSensor(SensorPort.S2);
          int t,g;
            while(true)
            {
               g = (int)compas.getDegrees();
               t = seeker.getDirection();
               seeker.setAddress(0x8);
               System.out.println("Grados"+g);
               System.out.println("Dir"+t);
            }       
    }
}


I'm using:
- Jdk-6u25-windows-i586
- Lejos_nxj_0.9.0
- Eclipse
- Win 7--64
Last edited by nikita190 on Mon Apr 09, 2012 10:12 pm, edited 1 time in total.
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron
more stuff