Go to Post Viva La FIRST Revolucion! - phrontist [more]
Home
Go Back   Chief Delphi > Technical > Programming
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
Innovation First International, Inc.
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
OLHSA
ADVERTISEMENT

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-11-2006, 11:45 AM
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
Using a button on a joystick to track?

We dont want to always have the camera tracking and such, is it possible to start tracking only when a button is pressed, and then stopping when the button is pressed again? What functions would we need to call to use that, and how would we get it to use a different purpose once the button is pressed a second time? I tried doing this before for another purpose but it didnt work, so if someone could help that would be pretty super. Thanks all.
  #2   Spotlight this post!  
Unread 02-11-2006, 02:58 PM
Jared341's Avatar
Jared341 Jared341 is offline
Congrats to the Champs!
AKA: Jared Russell
FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: Philadelphia, PA
Posts: 2,410
Jared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond reputeJared341 has a reputation beyond repute
Send a message via AIM to Jared341
Re: Using a button on a joystick to track?

try this:

Code:
// at beginning of Default_Routine)
static unsigned char p1_sw_trig_old = 0;
...
// later in your Default_Routine)
if( p1_sw_trig  && !p1_sw_trig_old )
{
  // Call function(s) to start tracking
}
else if( !p1_sw_trig && p1_sw_trig_old )
{
  // Call function(s) to stop tracking
}
p1_sw_trig_old = p1_sw_trig;
  #3   Spotlight this post!  
Unread 02-11-2006, 10:26 PM
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
Re: Using a button on a joystick to track?

ok, but what are the functions that i should be using for getting the camera to start and stop tracking. (thanks for that code, ill try that out on monday)
  #4   Spotlight this post!  
Unread 02-12-2006, 12:16 AM
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Marina Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 170
seg9585 is a splendid one to beholdseg9585 is a splendid one to beholdseg9585 is a splendid one to beholdseg9585 is a splendid one to beholdseg9585 is a splendid one to beholdseg9585 is a splendid one to beholdseg9585 is a splendid one to behold
Re: Using a button on a joystick to track?

Quote:
Originally Posted by DemonYawgmoth
ok, but what are the functions that i should be using for getting the camera to start and stop tracking.
Servo_Track() is the function which performs camera track and search
  #5   Spotlight this post!  
Unread 02-12-2006, 12:58 AM
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
Re: Using a button on a joystick to track?

So we would be calling that to start tracking, I'm assuming, from your post? And also, how would we make it stop tracking?
  #6   Spotlight this post!  
Unread 02-12-2006, 10:17 AM
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,051
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: Using a button on a joystick to track?

To have the camera servos track the target, call the Servo_Track() function. To not have the camera servos track the target, don't call the function
Closed Thread


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
Free programming help Cuog Programming 24 01-24-2006 03:43 PM
Change joystick to pwm mapping Joe Lewis Programming 3 03-30-2005 06:27 PM
Joystick Hat button ten3brousone Programming 8 02-20-2005 12:31 PM
Joystick Button programming Bharat Nain Programming 5 02-18-2005 10:48 AM
Joystick Button Deference cibressus53 Electrical 3 11-01-2004 08:38 AM


All times are GMT -5. The time now is 02:51 PM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School