OCCRA
Go to Post Great things don't just happen to HoF teams; HoF teams make great things happen. - Siri [more]
Home
Go Back   Chief Delphi > Technical > Programming > WindRiver C++
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-06-2009, 07:34 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
Joystick Trigger Programming

I am using WindRiver and all of the posts for the trigger programming are for LabVIEW. Could anyone help me with the programming of the buttons on the joysticks in WindRiver? Thanks a lot.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-06-2009, 07:35 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
Re: Joystick Trigger Programming

If anyone knowns how to program limit switches that would be helpful as well. Thanks again.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-06-2009, 08:13 PM
byteit101's Avatar
byteit101 byteit101 is offline
Registered Code Monkey (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Sylvania
Posts: 667
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Joystick Trigger Programming

Joystick stick(1);//channel 1
if (stick.GetRawButton(1-11))//1 is the trigger button, 2-11 the buttons labled as such
{
...
}
DigitalInput di(1);//channel 1
if (di->Get())
{
...
}
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI
Reply With Quote
  #4   Spotlight this post!  
Unread 02-07-2009, 01:59 PM
bwobo bwobo is offline
Team 1458
FRC #1458
Team Role: Engineer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: California
Posts: 15
bwobo is just really nicebwobo is just really nicebwobo is just really nicebwobo is just really nice
Send a message via AIM to bwobo
Re: Joystick Trigger Programming

Is there not a GetTrigger function in Joystick.h?
I don't have the header files here, but i think there is one. (you can check)
EDIT:
in Joystick.h, there is a GetTrigger function, as well as just the normal numbered 1-11 buttons
Code:
virtual bool GetTrigger(JoystickHand hand = kRightHand);
bool GetRawButton(UINT32 button);
that is from the header file, so you would just use GetTrigger and GetRawButton

Byteit is good on the limit switch too,I think not sure, that the Jaguars also have built in limit switch support, no code required
__________________

Last edited by bwobo : 02-07-2009 at 09:00 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-07-2009, 03:26 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
Re: Joystick Trigger Programming

Thank you all
Reply With Quote
  #6   Spotlight this post!  
Unread 02-07-2009, 07:10 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 7,916
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Send a message via AIM to Alan Anderson
Re: Joystick Trigger Programming

Quote:
Originally Posted by bwobo View Post
...Jaguars also have built in limit switch support,...
...which the 2009 rules do not permit using, alas.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-09-2009, 06:52 AM
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 Send a message via Skype™ to kyungjin
Re: Joystick Trigger Programming

You could use the GetTrigger function or use Button1 if you're using the standard joystick...
Reply With Quote
  #8   Spotlight this post!  
Unread 02-09-2009, 07:27 PM
csshakka csshakka is offline
Registered User
FRC #0818
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Warren, MI
Posts: 21
csshakka is an unknown quantity at this point
Send a message via AIM to csshakka Send a message via MSN to csshakka
Re: Joystick Trigger Programming

You can use the GetTrigger() function. Something like this:
Code:
Joystick *stick;
stick = new Joystick(1);

if (stick->GetTrigger())
{
    // Code if trigger is held
}
else
{
    // Code if trigger is released
}
Buttons are similar, but you use the GetRawButton() command.

Code:
Joystick *stick;
stick = new Joystick(1);

if (stick->GetRawButton(1-11))
{
    // Code if button is held
}
else if (!stick->GetRawButton(1-11))
{
    // Code if button is released
}

Last edited by csshakka : 02-09-2009 at 07:29 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 the joystick trigger... pudgeball WindRiver C++ 4 01-10-2009 10:25 AM
Joystick Programming greatman05 Programming 11 01-30-2008 08:40 PM
Joystick Programming LieAfterLie Programming 7 02-15-2007 09:30 AM
Programming a Joystick sbf2009 Programming 3 02-10-2007 03:59 PM
Joystick Programming team 803 Programming 6 02-21-2006 11:49 AM


All times are GMT -5. The time now is 04:31 PM.

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


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