Go to Post Is there a way to spotlight an entire thread? - ctt956 [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-02-2011, 12:58
nyindojin nyindojin is offline
Registered User
FRC #3059
 
Join Date: Jan 2009
Location: New York
Posts: 34
nyindojin is an unknown quantity at this point
Help with sevo programming

i have done research on how to program the servo with camera, and came up with the following code, my question is how to program in labview so that when a press lets say button 3 on joystick /1 (joystick 2) it turns right /(up), button 2 it turns left/ (down), then back to the orginal position (not sure what loop to use)
Attached Thumbnails
Click image for larger version

Name:	code help.JPG
Views:	70
Size:	38.1 KB
ID:	10072  
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2011, 14:09
legogeek24's Avatar
legogeek24 legogeek24 is offline
Registered User
AKA: Dirk
FRC #3562 (LiveWire)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Pocatello, ID
Posts: 94
legogeek24 has a spectacular aura aboutlegogeek24 has a spectacular aura aboutlegogeek24 has a spectacular aura about
Re: Help with sevo programming

I'm not entirely sure what you're asking, but when I programmed our servo code, when a button was pressed, the servo would move and stay in that position until it was told to move elsewhere. I used a case statement for each servo. I threaded the bool value from the get -> Button 3 (or whatever button you choose) to the case statement. If the button is pressed, move the servo a few degrees. If not, do nothing. It's simple code, but is working fine for us. I hope that helps
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2011, 14:57
nyindojin nyindojin is offline
Registered User
FRC #3059
 
Join Date: Jan 2009
Location: New York
Posts: 34
nyindojin is an unknown quantity at this point
Re: Help with sevo programming

I am sorry, what I meant was: say I press button 3, the servo moves then goes back to the original position.

In the programming I did; the begin vi is shown on the bottom and what I programmed in teleoperated is on the right. Both of them are placed exactly like that in those places not in any loops or case structures.

I have made the following changes...

Do you have a picture or jpeg of your code?

Thank you.
Attached Thumbnails
Click image for larger version

Name:	cameracodehelp2.JPG
Views:	44
Size:	43.3 KB
ID:	10075  

Last edited by nyindojin : 12-02-2011 at 15:17.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2011, 12:22
bstites82 bstites82 is offline
Registered User
AKA: Blake Stites
FRC #2164 (multiple)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Harrisonville
Posts: 12
bstites82 is an unknown quantity at this point
Re: Help with sevo programming

So if I understand you correctly you want the camera pan -10 degrees when button 3 is pressed, pan +10 when button 4 is pressed, and return to zero degrees when the driver lets go of either button? If this is indeed what your after then all you need to do with the code from your last screen shot is this. For each axis you have 2 case structures, drag a new case structure around both of them so that they are nested inside the true case, then wire a branch from each button to a boolean OR to the trigger of that case structure. what that does is once either button is pressed it allows the value of whichever button was pressed to be passed to your current code. then in the false case of the new case structure use a servo set angle to 0. so that when the button goes false (released) the servo returns to zero. the reason you cant just add it to the false cases you already have is that when you press button 4, button 3 is still false and commanding 0, while button 4 is commanding 10, you can see the conflict right? I don't have labview here so I can't take a screen shot. hope this helps.
Reply With Quote
Reply


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 20:36.

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