Capstone Project Help Needed( Droid/bluetooth)

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

Moderators: 99jonathan, roger, imaqine

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby Sylvan » Thu Mar 01, 2012 4:08 pm

I've noticed an Unhandled event loop error in the console.

http://i.imgur.com/bJ2dV.jpg

Thats the expanded error log, I'm unaware if leJOS has something similar to logcat.
Sylvan
New User
 
Posts: 12
Joined: Mon Feb 27, 2012 7:30 pm

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby skoehler » Thu Mar 01, 2012 4:19 pm

Sylvan wrote:I've noticed an Unhandled event loop error in the console.

http://i.imgur.com/bJ2dV.jpg

Thats the expanded error log, I'm unaware if leJOS has something similar to logcat.


Which Eclipse version?
In both Helios (3.6) and Indigo (3.7), the method JavaApplicationLaunchShortcut.getJavaElements(Object[] objects) is protected. That shouldn't be a problem, since LaunchNXTShortcut extends JavaApplicationLaunchShortcut
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby Sylvan » Thu Mar 01, 2012 4:33 pm

http://www.eclipse.org/downloads/packag ... alileo/sr1

Eclipse IDE for Java EE Developers - Galileo, I think its a variant of 3.5.1

I'd read some time ago that an older version of Eclipse was better to use with leJOS.
Sylvan
New User
 
Posts: 12
Joined: Mon Feb 27, 2012 7:30 pm

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby skoehler » Thu Mar 01, 2012 4:38 pm

Sylvan wrote:http://www.eclipse.org/downloads/packages/release/galileo/sr1

Eclipse IDE for Java EE Developers - Galileo, I think its a variant of 3.5.1

I'd read some time ago that an older version of Eclipse was better to use with leJOS.


The current plug-in is for Eclipse 3.6 and above. I should probably mention that somewhere.
If you're not limited by other constraints (e.g. unavailable plug-in) you should update to Indigo (3.7).
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby Sylvan » Thu Mar 01, 2012 5:58 pm

Now running indigo as you suggested, seems to run fine so far.

However I've hit a snag. I think I've locked up my brick by running a test program I made.

Code: Select all
import lejos.nxt.*;

public class motorTest {

   /**
    * @param args
    */
   public static void main(String[] aArg) throws Exception
   
   {
      String m1 = "Motor A: ";
      String m2 = "Motor B: ";
      String p = "Port S1: ";
      
      TouchSensor touch = new TouchSensor(SensorPort.S1);
      
      for(;;) {
         LCD.clear();
         LCD.drawString(m1, 0, 1);
         LCD.drawInt(Motor.A.getTachoCount(), 9, 1);
         LCD.drawString(m2,0,2);
         LCD.drawInt(Motor.B.getTachoCount(), 9, 2);
         LCD.drawString(p,0,4);
         LCD.drawInt(SensorPort.S1.readRawValue(),9,4);
         Motor.A.setSpeed(200);
         Motor.B.setSpeed(200);
         if (touch.isPressed()) Motor.A.forward();Motor.B.forward();
         Thread.sleep(1000);
         if (touch.isPressed()) Motor.A.stop();Motor.B.stop();
         LCD.refresh();
         Thread.sleep(1000);
         
         
      }
   }

}


Using this code caused the Brick LCD to display the following:

Motor A:0
Motor B:0

Port S1: 1023


EDIT:

Ok, forget the code, I've figured out what was happening in that regard, just can't exit this program.

EDIT 2:

Now looking for a sufficiently sized paperclip. If you guys have any thoughts on preventing this occurring I'd appreciate it.

Edit 4:
Code updated

Hard Reset using paperclip, seems fine so far, but running that program again locks it up.

Unexpected behavior. When the program executes Motor B is moving already in short intervals. When the touch sensor is pressed, Motor A syncs movement with B.
Sylvan
New User
 
Posts: 12
Joined: Mon Feb 27, 2012 7:30 pm

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby skoehler » Thu Mar 01, 2012 7:16 pm

Just press Enter+Escape (the buttons in orange and dark grey) to get back to the menu of the NXT, unless you see a data abort. Then we need to work out why you see a data abort.
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Re: Capstone Project Help Needed( Droid/bluetooth)

Postby Sylvan » Thu Mar 01, 2012 7:29 pm

Thanks, I bet that was something I missed in the manual.
Sylvan
New User
 
Posts: 12
Joined: Mon Feb 27, 2012 7:30 pm

Previous

Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff