Beginner

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

Moderators: 99jonathan, roger, imaqine

Beginner

Postby abalis3 » Sat Jan 14, 2012 11:22 pm

I want to control 2 motors forward and backwards (Motor.A and Motor.B) totally seperate from each other but I cannot figure out Lejos at all. I followed a couple tutorials for using eclipse and creating a shortcut to a nxj compiler and nxj uploader but when I run the compiler i get the error:

"javac: file not found: BasicMotorTest.java
Usage: javac <options> <source files>
use -help for a list of possible options"

I cant even figure out how to upload a simple program to move the motor forward with eclipse. Then once I figure out how to upload the program, I'd like some help with how you might actively control a motor from the computer with usb connection. I've read about programs on the nxt that listen for a connection but I cant even upload one onto it until i figure it out.

If I get help with uploading to the nxt, If someone could just write a simple program for actively communicating over usb to just like move motor.A forward until the program is terminated so i can see how its done.

Thanks
abalis3
New User
 
Posts: 6
Joined: Sat Jan 14, 2012 4:03 am

Re: Beginner

Postby skoehler » Sun Jan 15, 2012 12:44 am

I'm sorry to hear that. The good news is, that the tutorial you follows seems to be outdated. The leJOS Eclipse plug-in is a much easier way of doing things.
I'm updating the tutorial right now. An updated version of the tutorial will be released soon.

In the mean time:
Install the plug-in from this update site: http://lejos.sourceforge.net/tools/eclipse/plugin/nxj/. Then create a new leJOS PC project using File -> New -> Project. Put your code in that new project, and run your application using right click on project -> Run As -> Java application.
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: Beginner

Postby abalis3 » Sun Jan 15, 2012 1:38 am

Ok im figuring that out now but in the mean time its ok because I can just compile and upload with cmd but now I would still like some help with just a program to control a motor from the pc
abalis3
New User
 
Posts: 6
Joined: Sat Jan 14, 2012 4:03 am

Re: Beginner

Postby roger » Mon Jan 16, 2012 2:57 am

Take a look at the documentation for the regulated motor here:
http://lejos.sourceforge.net/nxt/nxj/api/lejos/nxt/NXTRegulatedMotor.html
The example almost works, but use
Delay.msDelay(1000) ;
instead of
ThreadSleep();
and ignore the
ThreadYield();
I recommend that motor control code runs on the NXT, not on the PC.
Good luck,
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: Beginner

Postby kaczor » Mon Jan 16, 2012 3:04 am

roger wrote:I recommend that motor control code runs on the NXT, not on the PC.

I fully agree. It is harder to debug things, but this is right. leJOS for PC lacks for several features which work directly on the brick. I have some frustrating moments and then I've read some features are just not implemented in the PC leJOS environment.
User avatar
kaczor
New User
 
Posts: 12
Joined: Mon Jan 16, 2012 12:29 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

cron
more stuff