|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: Using a button on a joystick to track?
Quote:
|
|
#5
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |