Motors out of sync + Eclipse upload issue

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

Moderators: imaqine, 99jonathan, roger

New User
Posts: 4
Joined: Fri Nov 18, 2011 2:56 am

Motors out of sync + Eclipse upload issue

Postby Doolali » Fri Nov 18, 2011 3:16 am

I'm new to leJos and what I've played with so far is great.

The first issue im having is with eclipse. It will upload my program when I run eclipse for the first time, after that it gives me the following error, which can only be sorted by restarting eclipse.

Code: Select all

// First attempt
Initializing LeJOS JDK at C:\Program Files\leJOS NXJ
program has been linked successfully
uploading ...
leJOS NXJ> Connected to NXT
leJOS NXJ> Upload successful in 1217 milliseconds
program has been uploaded
program has been linked successfully

// second attempt
uploading ...
leJOS NXJ> Failed to open Unknown 0016530CC773
leJOS NXJ> Failed to connect to any NXT
No NXT found - is it switched on and plugged in (for USB)?
uploading the program failed with exit status 1

The second issue I'm having is with the motors, I'm trying to get them to start and stop at the same time which they don't seem to like.

The code below will start both motors at the same time, when I press the button or wait for the thread sleep to finish, A will stop and C will continue for a little bit longer, I have also tried port B, and if I swap the stop order of A and C they do change which stops first.

Code: Select all

      LCD.drawString("FORWARD", 0, 0);
      LCD.drawString("STOP", 0, 1);

One last thing that I have no yet experimented with yet, but I tried using the leJOS colour sensor demonstration and all values were reading -1 and the sensor was not turned on. I tried each of the port 1-4 with no luck, am I missing something?

Any help is much appreciated! Thanks in advance.

User avatar
leJOS Team Member
Posts: 305
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: Motors out of sync + Eclipse upload issue

Postby kirkpthompson » Fri Nov 18, 2011 3:50 am

Search the forums on the Eclipse timeout issue. There is an update (or new version) that fixes this.

re: the motor issue: What motor class are you using?

Leg Godt!

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

Re: Motors out of sync + Eclipse upload issue

Postby gloomyandy » Fri Nov 18, 2011 9:40 am

Which color sensor do you have there are two different types. The Lego sensor which comes with the NXT 2.0 kit: ... Sensor.jpg
and the HiTecnic sensor: ... AA300_.jpg

The test program you are running only supports the Lego Sensor...

Also which version of leJOS are you running?


New User
Posts: 4
Joined: Fri Nov 18, 2011 2:56 am

Re: Motors out of sync + Eclipse upload issue

Postby Doolali » Fri Nov 18, 2011 12:23 pm

Motor problem corrected as follows

Code: Select all

DCMotor motor = null;
      motor = new NXTMotor(MotorPort.A);
      DCMotor motorB = null;
      motorB = new NXTMotor(MotorPort.B);

leJos version 0.9.0 rev 4498 on my NXT with the latest plugin for eclipse.

Fixed eclipse restart problem with test plugin -

I have the NXT colour sensor that comes with the 2.0.
Edit: fixed colour sensor, was using the HT class.

No more problems for now! Thanks for the help!

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 2 guests