Quote:
Originally Posted by TheModMaster8
Code:
while(true)
{
control.poll();
//Start=control.isButtonPressed(7);
/**System.out.print(control.getAxisValue(0));
System.out.print(" ");
System.out.print(control.getAxisValue(1));
System.out.print(" ");
System.out.print(control.getAxisValue(2));
System.out.print(" ");
System.out.print(control.getAxisValue(3));
System.out.print(" ");
System.out.print(control.getAxisValue(4));
System.out.print(" ");
System.out.print(control.getAxisValue(5));
System.out.println(); */
Virtual_JoyStick joy = new Virtual_JoyStick();
joy.repaint();
}
|
I'm not sure what each line of this is doing, but assuming those are the correct methods, all you have to do is assign their values to variables instead of printing them (see below). From there, you need to figure out how you are getting the commands from the computer to the NXT. For this you would want to also include a bluetooth library on the computer side. I would imagine that Lejos has methods for bluetooth on the NXT side.
Code:
axisZero = control.getAxisValue(0);
Hope that helps.
EDIT: what do the last 2 lines of the while loop do? it seems like that might not be something you want to do for every iteration of the loop, but I could be wrong.
EDIT (again): I see that the constructor called in the lines I referenced above is the constructor for the parent class. Is the start class the class that you are using to run the program in the JVM, or is it a class that you intend to use to create start objects? I assumed the former since you omitted a constructor but included a main() method, but it occurred to me that you might have intended the latter.