View Single Post
  #8   Spotlight this post!  
Unread 18-01-2007, 11:07
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: 1 joystick or 2?

I would say setup your OI for two, but have a switch to change between 1, 2, or xbox.

you could use code like this. You would need to wire a toggle switch to Port3 Top and Port3 Trig, but thats simple.
Code:
if (p3_sw_trig)//one joy
{
  pwm01 = Limit_Mix(2000 + p1_y - p1_x + 255);
  pwm02 = Limit_Mix(2000 + p1_y + p1_x - 255);
}
else if (p3_sw_top)//xbox
{
  //xbox control code here.
}
else //two stick
{
  pwm01 = p1_y;
  pwm02 = p2_y;
}
If you have any questions PM or e-mail me.
__________________
Eric Haskins KC9JVH

Last edited by EHaskins : 18-01-2007 at 11:08. Reason: Code error.