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
Motor.A.setSpeed(7200);
Motor.C.setSpeed(7200);
Motor.A.forward();
Motor.C.forward();
LCD.drawString("FORWARD", 0, 0);
//Thread.sleep(1000);
Button.waitForPress();
Motor.A.stop();
Motor.C.stop();
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.
