Go to Post I wanted my team to be rewarded for something they do, not because they do it for the award. - MikePres [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 25-05-2015, 17:41
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,190
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Need help with lego NXT lejos xbox controlling

Quote:
Originally Posted by TheModMaster8 View Post
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.
__________________

Last edited by PAR_WIG1350 : 25-05-2015 at 17:52.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi