Go to Post FIRSTers in particular want very strictly delineated guidelines so that they know exactly what parameters under which they're working, except when they don't. - pfreivald [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2006, 12:45
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 11-02-2006, 15:58
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
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 11-02-2006, 23:26
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 12-02-2006, 01:16
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Surf City Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 520
seg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond repute
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 12-02-2006, 01:58
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 12-02-2006, 11:17
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: 9,113
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
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 24-01-2006 16:43
Change joystick to pwm mapping Joe Lewis Programming 3 30-03-2005 19:27
Joystick Hat button ten3brousone Programming 8 20-02-2005 13:31
Joystick Button programming Bharat Nain Programming 5 18-02-2005 11:48
Joystick Button Deference cibressus53 Electrical 3 01-11-2004 09:38


All times are GMT -5. The time now is 03:13.

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