Go to Post do the math, then use the math to go for total overkill. - pfreivald [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-07-2009, 05:22 PM
dnrobotics11 dnrobotics11 is offline
Registered User
FRC #2589
 
Join Date: Mar 2008
Location: Massachusetts
Posts: 55
dnrobotics11 is an unknown quantity at this point
How do you open a new C++ file with WindRiver?

How do you open a new C++ file with WindRiver? I've already downloaded the FIRST version and it is working but I do not know how to actually make a new program. Thanks for the help.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-08-2009, 04:06 PM
dnrobotics11 dnrobotics11 is offline
Registered User
FRC #2589
 
Join Date: Mar 2008
Location: Massachusetts
Posts: 55
dnrobotics11 is an unknown quantity at this point
I NEED HELP

--------------------------------------------------------------------------------

I have set up the WindRiver programming compiler but first of all, I don't know how to set up a FIRST code template with the three phases of competition as subroutines. Also, I am extremely lost in regards to the configuration of the cRIO system with WindRiver. I set up the IP addresses but there is never a connection between the cRIO and the computer. I do not know what I'm doing. Can anyone help? Thank you
Reply With Quote
  #3   Spotlight this post!  
Unread 12-29-2008, 02:15 PM
kyungjin kyungjin is offline
Software Specialist
AKA: Daniel
VRC #0646
Team Role: Programmer
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Honolulu, Hawaii
Posts: 65
kyungjin is an unknown quantity at this point
Send a message via AIM to kyungjin Send a message via MSN to kyungjin
Re: Getting Familiar with Programming in WindRiver

Thanks both for the replies.

So in order to pull information from the HID joysticks, it has to be pure P&P that doesn't require any drivers whatsoever? So, if we find such as device, everything else should be preconfigured? For example, for a steering wheel, the wheel provides x-values, and the pedals provide the y-values? Or is there anyway to preset specific functions to specific buttons or features of the joystick?
Reply With Quote
  #4   Spotlight this post!  
Unread 12-29-2008, 03:28 PM
koreabell koreabell is offline
Team 956 Safety Captain
FRC #0956 (Eagles)
Team Role: Programmer
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Oregon
Posts: 24
koreabell is an unknown quantity at this point
Re: Getting Familiar with Programming in WindRiver

most of joysticks come with drivers when you buy, but that doesn't mean you necessarily need that driver.

if you plug the joystick into the driver station, it'll most likely recognize the device without driver(unless the joystick really need driver).

you'll need WPILib to get information of joystick status, which can be interpreted as it is preconfigured.

you can assign specific functions to corresponding buttons by making if or switch case statements.

for example
Code:
	int button[13]; // find which button is pushed
	int a = 0; //how many buttons are pushed?
	
	for(int i = 0; i < 12; i++){  //Get what button(s) is/are pushed and save it in array variable
		if(Joystick::GetRawButton((i+1)) == TRUE){
			button[a] = i;
			a++;
		}
	}

	for(int i = 0; i < a; i++){
		switch(button[i+1]){
			case 0:  //if nothing is pushed
				break;
			case 1:  //if button1 is pushed
				DoThis();
				break;
			case 2:  //if button2 is pushed
				DoThat();
				break;
			case 3:  //if button3 is pushed
				DoThese();
				break;
			case 4:  //if button4 is pushed
				DoThose();
				break;
			case 5:  //if button5 is pushed
				DoIt();
				break;
			case 6:  //if button6 is pushed
				GoThere();
				break;
			case 7:  //if button7 is pushed
				ComeHere();
				break;
			case 8:  //if button 8 is pushed
				Shoot();
				break;
			case 9:  //if button 9 is pushed
				RunAway();
				break;
			case 10:  //if button 10 is pushed
				Stop();
				break;
			case 11:  //if button 11 is pushed
				DisableYourself();
				break;
			case 12:  //if button 12 is pushed
				AbortAndCatchOnFire();
				break;
		}
	}
	a = 0;
	for(int i = 0; i < 12; i++){  //reset
		button[i] = 0;
	}
i think you can have up to 12 buttons and i doubt you'll assign all 12 buttons to its corresponding functions but that's one way to do it.

the other way is having a lot(depends on how many buttons you'll be assigning specific functions to) of if and else if statements

there might be other ways but I can't think of it at the moment

Last edited by koreabell : 12-29-2008 at 03:34 PM.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming - Getting Started Mark McLeod Programming 80 04-16-2008 11:37 PM
Help Getting Started with VEX programming. Joe Johnson VEX 5 04-16-2007 09:01 AM
pic: Mobot with familiar parts jgannon Extra Discussion 11 04-24-2006 06:55 PM
programming motors with programming kit BorisTheBlade FIRST Tech Challenge 4 11-01-2005 07:03 PM
Programming and Electronics — Getting Started Sidney San Martín Technical Discussion 7 01-12-2005 03:25 PM


All times are GMT -5. The time now is 09:26 AM.

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