Go to Post 119.9999999 pounds...if only the programmers could make the code a bit lighter! - James1902 [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 14-02-2011, 18:00
zransom515 zransom515 is offline
Registered User
AKA: MSU bound programmer
FRC #2420 (RoboTitans)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2008
Location: Atlanta Georgia
Posts: 1
zransom515 is an unknown quantity at this point
Smile How to program motors in two different directions.?

So I have been on my FRC team for four years. This is my first year actually programming. In previous years I have helped with awards and public relations. We have an arm for the FRC 2011 LOGOMOTION. I have programmed for the basic drive. I am having a problem programming the motors, so that when a button is pressed it spins one way and when another button is pressed it spins another. How do I go about doing that?
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2011, 18:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to program motors in two different directions.?

Quote:
Originally Posted by zransom515 View Post
I am having a problem programming the motors, so that when a button is pressed it spins one way and when another button is pressed it spins another. How do I go about doing that?



See attached image.


Attached Thumbnails
Click image for larger version

Name:	fwd or rev.png
Views:	209
Size:	4.4 KB
ID:	10113  
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2011, 23:43
baronep's Avatar
baronep baronep is offline
Student President
FRC #2848 (Jesuit All-Sparks)
Team Role: Leadership
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Dallas TX
Posts: 167
baronep is on a distinguished road
Re: How to program motors in two different directions.?

You could also use two case structures, one inside the other, each controlled by a button on your controller. The only trick is that there is one case where both buttons are pressed. In that case you could either have the motor stop or continue in one of the two directions, but practically speaking, this isn't a big deal.
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 04:28.

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