Go to Post I think we need to take away your hammer privileges. - Katy [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 01-09-2012, 11:10
Dexterium's Avatar
Dexterium Dexterium is offline
Registered User
AKA: Adam Poindexter
FRC #1208 (Metool Brigade)
Team Role: Programmer
 
Join Date: Sep 2012
Rookie Year: 2011
Location: United States
Posts: 24
Dexterium is an unknown quantity at this point
Talking Re: Joystick Controls

your problem is the code. Whenever you move the joystick you are sending a constant value to the motor/servo/whatever. That constant value is causing the whatever to constantly turn. What you need to do is use the servo set position this takes a value from 0 to 1 from an input and matches it to the servo's position. use this along with some math and the joystick to make it work. Lets say that your servo range (the range of possible/wanted motion) is 90 degrees. You would specify this in the begin vi with servo open. For this to work right you would want is set up like this:

0 degree position(all the way in one direction)=0 servo position=(-1) Joystick position

45 degree position(straight/level)=.5 servo position=0 Joystick Position

90 degree position (all the way the other direction)=1 servo position=1 Joystick position

The degree refrences don't really matter for the sake of the programming they are just there for refrence. What you really need to do is find some math(i have no clue what) to put between the joystick output value and the servo input value that makes 0=-1, .5=0, and 1=1. Once you do this your home free.

See below

Last edited by Dexterium : 01-09-2012 at 11:34.
Reply With Quote
 


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


All times are GMT -5. The time now is 10:52.

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