Go to Post It's always better to figure out why a design actually works and the best ways to implement it than to just assume upgrading to a "better" material will make everything work. - Cory [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 06-02-2011, 14:34
Slothbron's Avatar
Slothbron Slothbron is offline
Registered User
AKA: Nathan
FRC #3216 (Missoula Robotics Team)
Team Role: Engineer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Montana
Posts: 35
Slothbron is an unknown quantity at this point
Question Making Joystick buttons control moters

We where a rookie team last year, but we lost all of are programmers and the simple codes they made last year. I'm new to programing and but confused with some stuff. One thing I want to know is how you can program a motor so that when you press one button it makes the motor run one direction. But then when you press another button the motor moves the opposite direction. These motors are going to be used to raise and lower are arm and open and close the claw. Also we are planning on having victor speed controls hooked up to them is it any different to program them with the speed controls?
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2011, 14:50
mjbrauck mjbrauck is offline
Registered User
FRC #0768 (Techno Warriors )
 
Join Date: Jan 2006
Rookie Year: 2005
Location: maryland
Posts: 23
mjbrauck has a spectacular aura aboutmjbrauck has a spectacular aura about
Re: Making Joystick buttons control moters

What program language are you using? In general you just have to check the button states and put a conditional statement in your tele-op code to set the motor speed.
be sure to cover the condition when both buttons are pressed a If else If statement is a good way to go.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2011, 15:00
Slothbron's Avatar
Slothbron Slothbron is offline
Registered User
AKA: Nathan
FRC #3216 (Missoula Robotics Team)
Team Role: Engineer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Montana
Posts: 35
Slothbron is an unknown quantity at this point
Re: Making Joystick buttons control moters

We are using Labview this year for programing. So far I have been able to figure out how to control the drive motors with the joystick 2 axis. But now I want to make it so when I press and hold say button 2 on the joystick another motor moves on the robot one direction. The when I press and hold say button 3 that motor now moves the opposite direction then as before.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2011, 15:09
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: Making Joystick buttons control moters

Here are two similar, common ways to do this in Labview. The first way uses two Select statements and allows you to later change the motor power in both directions if you decide you don't want full power. You can also replace one of the select statements with a Boolean to Integer conversion.
Attached Thumbnails
Click image for larger version

Name:	Buttons2.jpg
Views:	152
Size:	23.7 KB
ID:	10006  Click image for larger version

Name:	Buttons.jpg
Views:	122
Size:	21.6 KB
ID:	10007  
__________________


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
  #5   Spotlight this post!  
Unread 06-02-2011, 15:17
Slothbron's Avatar
Slothbron Slothbron is offline
Registered User
AKA: Nathan
FRC #3216 (Missoula Robotics Team)
Team Role: Engineer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Montana
Posts: 35
Slothbron is an unknown quantity at this point
Re: Making Joystick buttons control moters

Quote:
Originally Posted by Vikesrock View Post
Here are two similar, common ways to do this in Labview. The first way uses two Select statements and allows you to later change the motor power in both directions if you decide you don't want full power. You can also replace one of the select statements with a Boolean to Integer conversion.
I will give this a try and see if it does what i want it to. Thanks
__________________
MRT 3216
2010- Salt lake City Highest Rookie Team seed
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2011, 21:03
Slothbron's Avatar
Slothbron Slothbron is offline
Registered User
AKA: Nathan
FRC #3216 (Missoula Robotics Team)
Team Role: Engineer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Montana
Posts: 35
Slothbron is an unknown quantity at this point
Re: Making Joystick buttons control moters

Quote:
Originally Posted by Vikesrock View Post
Here are two similar, common ways to do this in Labview. The first way uses two Select statements and allows you to later change the motor power in both directions if you decide you don't want full power. You can also replace one of the select statements with a Boolean to Integer conversion.
Just got done with robotics meeting and this worked great just what I needed.
__________________
MRT 3216
2010- Salt lake City Highest Rookie Team seed
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:30.

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