View Single Post
  #2   Spotlight this post!  
Unread 18-03-2010, 00:12
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Motor Speed with joysticks

One way to do this would be to pass the joystick values through a case structure before they go to the Robot Drive VI you are using (Arcade, Tank, etc.)

Wire the two buttons you want to have pressed into an AND and the result of the AND into the Case Selector Terminal (the little green question mark). Now if both buttons are pressed you will be in the True case and if either or both aren't pressed you will be in the False case.

Now we need to put the correct operations in each case. In the True case you want full forward on the sticks to be full power, this means that the joystick values should pass straight through the case structure unmodified.

In the false case you want to scale the value down to 25% of the maximum. To accomplish this divide each of the joystick axis values by 4 in the false case before passing them out.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote