|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
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;
}
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |