Help: flt() method locks motor up.

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

Moderators: 99jonathan, roger, imaqine

Help: flt() method locks motor up.

Postby SOMMS » Thu Mar 06, 2008 5:00 pm

Amigos,

For some reason the Motor.A.flt() method does not work for me. I know its suppose to let the motor 'coast' to a stop, but instead it locks the motor up and I neither Motor.A.forward() or Motor.A.backward() work thereafter? What gives?

Here is the chunk of code that works (calls stop).
NXTCommand.open();

Motor.A.setSpeed(200);
Motor.C.setSpeed(200);

System.out.println("forward...");
Motor.A.forward();
Motor.C.forward();
try
{
Thread.sleep(2000);
}
catch (Exception e)
{
e.printStackTrace();
}
System.out.println("stopping...");
Motor.A.stop();
Motor.C.stop();

// forward and backward still work!




Here is the chunk of code that doesn't work (calls flt)
NXTCommand.open();

Motor.A.setSpeed(200);
Motor.C.setSpeed(200);

System.out.println("forward...");
Motor.A.forward();
Motor.C.forward();
try
{
Thread.sleep(2000);
}
catch (Exception e)
{
e.printStackTrace();
}
System.out.println("stopping...");
Motor.A.flt();
Motor.C.flt();

// forward and backward don't work!



Running Eclipse, JDK 1.5, Bluecove, ICommand 0.7, Abe dongle. Any ideas?


Thanks


SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby bbagnall » Thu Mar 06, 2008 8:56 pm

Hmm, that might be a bug in the latest version of iCommand. I'll take a look into that before the next release.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby SOMMS » Fri Mar 07, 2008 7:38 am

bbagnall wrote:Hmm, that might be a bug in the latest version of iCommand. I'll take a look into that before the next release.


I was thinking it might be something like that so I backed out to ICommand 0.6, ran the same code and the same thing happened.

I take it this is not happening to you?


Thanks


SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby bbagnall » Sun Mar 09, 2008 5:19 pm

I haven't really tested the flt() methods since early versions. The firmware on the NXT brick might be a factor. Are you using the standard LEGO firmware or leJOS NXJ?
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby SOMMS » Tue Mar 11, 2008 7:46 pm

bbagnall wrote:I haven't really tested the flt() methods since early versions. The firmware on the NXT brick might be a factor. Are you using the standard LEGO firmware or leJOS NXJ?



I think I'm using the latest LEGO firmware (1.05). Do I need LeJOS NXJ instead?
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby bbagnall » Wed Mar 12, 2008 7:08 pm

Technically it is supposed to work with the standard Lego firmware and seemed to work fine every time I used it in the past. I was using iCommand 0.7 with the leJOS NXJ firmware today and flt() works fine. Maybe Lego made some changes to their firmware with 1.05. Come to think of it, I don't think I've used 1.05 before.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby SOMMS » Thu Mar 13, 2008 8:03 pm

bbagnall wrote:Technically it is supposed to work with the standard Lego firmware and seemed to work fine every time I used it in the past. I was using iCommand 0.7 with the leJOS NXJ firmware today and flt() works fine. Maybe Lego made some changes to their firmware with 1.05. Come to think of it, I don't think I've used 1.05 before.


Crikey. So what I should really do is upload the LeJOS NXJ firmware to the device. Would have a link that would get me started in the right direction?

Thanks

SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby Spymaster101 » Fri Mar 14, 2008 1:54 am

If it is a tutorial you want, follow this one step by step and it should work:
http://www.bartneck.de/2008/03/04/java-lego-nxt-eclipse-tutorial :)

If you encounter any problems tell me, I've worked with about a hundred different problems in this tutorial. :D
"Life is like a train, someday it's gonna hit you. So you can either try to run away from it, or you can sit down, crack open a beer and watch it come."
Spymaster101
New User
 
Posts: 4
Joined: Thu Mar 13, 2008 2:46 am

Postby SOMMS » Fri Mar 14, 2008 3:44 pm

Spymaster101 wrote:If it is a tutorial you want, follow this one step by step and it should work:
http://www.bartneck.de/2008/03/04/java-lego-nxt-eclipse-tutorial :)

If you encounter any problems tell me, I've worked with about a hundred different problems in this tutorial. :D


Dude...thanks a ton. I'll get a chance to try this out later on today.

I'll let you know.


-SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby Spymaster101 » Fri Mar 14, 2008 6:48 pm

Yea anytime. :D :D
"Life is like a train, someday it's gonna hit you. So you can either try to run away from it, or you can sit down, crack open a beer and watch it come."
Spymaster101
New User
 
Posts: 4
Joined: Thu Mar 13, 2008 2:46 am

Postby SOMMS » Mon Mar 17, 2008 4:54 pm

Spymaster101 wrote:If it is a tutorial you want, follow this one step by step and it should work:
http://www.bartneck.de/2008/03/04/java-lego-nxt-eclipse-tutorial :)

If you encounter any problems tell me, I've worked with about a hundred different problems in this tutorial. :D



Hey Hey!!!!

Well big picture is...it flt() works now! But allow me a few constructive comments.


A-In the tutorial where it shows how to install the new firmware...there are 2 steps: one where you type 'lejosdl' (which verifies LeJos is properly installed) and the next step where you type 'lejosfirmdl' (which attempts to update NXT firmware). In step 2 there is a snippet about installing LibUSB. These 2 steps should really be 3 steps: A-verify LeJos installed, B-verify Libusb installed C-upload firmware.

What happened to me is Libusb installed in step 2 but then did not seem to actually update the NXT firmware...my NXT was in a brainless state. I tried a few things (via bluetooth) etc. I had to reboot my machine and rerun 'lejosfirmdl'...then everything started working.

So thank you very much.



My followup question would be this: flt() works, but now I can only run an ICommand program once before I get a 'Open of NXT failed: Failed to connect socket; [10064] A socket operation failed because the destination host was down.' error. Then what I have to do is turn off the NXT, turn it back on before I can use it again.

Any ideas on that one?


Thanks again.

SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby bbagnall » Wed Mar 19, 2008 4:18 am

SOMMS wrote:My followup question would be this: flt() works, but now I can only run an ICommand program once before I get a 'Open of NXT failed: Failed to connect socket; [10064] A socket operation failed because the destination host was down.' error. Then what I have to do is turn off the NXT, turn it back on before I can use it again.

Any ideas on that one?

Does it always do that? You should try ending all your iCommand programs with NXTCommand.close(), that way you won't have to turn the brick off-on each time (at least with leJOS NXJ).
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby SOMMS » Wed Mar 19, 2008 2:00 pm

bbagnall wrote:Does it always do that? You should try ending all your iCommand programs with NXTCommand.close(), that way you won't have to turn the brick off-on each time (at least with leJOS NXJ).


Yup. Always end with close(), but it still always hangs. :( Bummer. I have reinstalled the LEGO NXT 1.05 firmware and am going to look at the source code for ICommand 0.7. I've almost got the project going (in Eclipse). I just need the SunComm jar. Where would I get that?

Thanks

SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm

Postby SOMMS » Wed Mar 19, 2008 2:08 pm

Oops...I meant Javacomm. Found it. I'll see if I can get flt() working.

SOMMS
SOMMS
New User
 
Posts: 10
Joined: Thu Mar 06, 2008 4:40 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 6 guests

more stuff