Go to Post do i even have to say anything about hurricane jeanne after my comments about charley, frances and ivan? :mad: but if i could, i would run all of them over with my robot... - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-01-2009, 11:31
solomason519 solomason519 is offline
Registered User
FRC #0519
 
Join Date: Jan 2009
Location: detroit
Posts: 16
solomason519 is an unknown quantity at this point
programming a motor to two buttons

hey im new to chief del phi as well as to programming. I have configured a program to run a motor on button six on the attack controller. however i dont know how program buttton seven to reverse the same motor. help please.....

In my second while loop is where my window motor is i already have it programmed to button six but i want it to be programed to button six and reverse by button seven....
Attached Files
File Type: vi motor new.vi (63.2 KB, 76 views)

Last edited by solomason519 : 28-01-2009 at 11:35. Reason: i want to add an attachment
  #2   Spotlight this post!  
Unread 28-01-2009, 12:24
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,685
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: programming a motor to two buttons

That's... an interesting way of turning a motor on and off with a button. A slightly cleaner and more expandable way is to use the Select function block (in the Programming>Comparison palette), or a set of Case Structures. The Select function block has one boolean input (green wire) and two other inputs that can be of many different types. It selects which of these two other inputs to pass to the output based on whether the boolean is true or false. I've put together the motor control you were looking for in the picture below using some select blocks. This particular wiring forces the forward button to override the reverse button. So if you have both buttons pressed, the motor will move forwards.
Attached Thumbnails
Click image for larger version

Name:	Button control.JPG
Views:	115
Size:	9.6 KB
ID:	7249  
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 28-01-2009, 12:37
solomason519 solomason519 is offline
Registered User
FRC #0519
 
Join Date: Jan 2009
Location: detroit
Posts: 16
solomason519 is an unknown quantity at this point
Re: programming a motor to two buttons

Thanks you so much kevin. You have helped me get to where i needed to be.....
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Joystick Buttons to toggle a motor on and off programmr C/C++ 6 25-01-2009 17:47
Programming a single relay to two buttons in easyC Pro? Gizmo2417 Programming 1 17-02-2008 17:10
Help Programming Buttons LordFrz Programming 3 14-02-2008 13:55
Programming Extra Joystick Buttons Inverted Programming 2 08-02-2007 11:45
Is it okay to run one motor in a two motor transmission? NoodleKnight Technical Discussion 27 16-12-2004 07:16


All times are GMT -5. The time now is 16:35.

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