Go to Post We considered naming our 2014 robot "Please Don't Point it at Me". I think the name fits. - KosmicKhaos [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 09-02-2007, 17:47
whlspacedude's Avatar
whlspacedude whlspacedude is offline
Registered User
AKA: Will
FRC #1529 (Cyber Cards)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Indianapolis,Indiana 46227
Posts: 167
whlspacedude is just really nicewhlspacedude is just really nicewhlspacedude is just really nicewhlspacedude is just really nice
Send a message via AIM to whlspacedude Send a message via MSN to whlspacedude Send a message via Yahoo to whlspacedude
WE NEED PGRM HELP

We need to be able to run a function when we push a button on the controller (trigger, thumb etc.). problem being that we have no clue how to run easy c. thanks!
__________________
Some people are like slinkies they are only good for 1 thing... pushing them down flights of stairs

1529 mph = 4 109 952 furlongs per fortnight
  #2   Spotlight this post!  
Unread 09-02-2007, 18:06
Imajie Imajie is offline
Registered User
AKA: James Letendre
FRC #0195 (Cyber Knights)
Team Role: Electrical
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Southington
Posts: 114
Imajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud ofImajie has much to be proud of
Send a message via AIM to Imajie
Re: WE NEED PGRM HELP

What you need to do is go into the Operator control function, and from the program flow tab on the left side drag a while loop into the function and put a 1 in the box that comes up this will cause the program to loop until the bot is turned off.
Then drag an if block from the same place and drag it inside the while loop, in the box that comes up type
Code:
GetOIDInput([the port you want], [the button number]) == 1
To see what each button number is from the input tab drag OI Digital Input block and the box that comes up will show you what each one is.
What this does is looks if the button is pressed if it is it returns a 1 if not it returns a 0, and the == 1 part looks to see if it is a 1, if it is the code in the if statement will execute otherwise it will skip it, so put whatever you want to have happen when that button is pressed in the if statement.


Here is an example of what the if statement would look like. This one checks if the second joystick trigger is pressed and if it is allows the joysticks to drive the motors.
Code:
        //Check if user drive
        if(GetOIDInput(2, 1)==1)
        {
            Joystick_Drive();
        }
I'm done rambling now
Hope this helps
__________________
2007 UTC Champions Thanks 1124 and 558
2007 UTC GM Industrial Design Award

2006 Newton Divisional Winners
2006 Championship finalists
(Thanks 25 and 968 for picking us!)
2006 National Innovation in Control

Last edited by Imajie : 09-02-2007 at 18:11. Reason: added example
  #3   Spotlight this post!  
Unread 15-02-2007, 14:35
whlspacedude's Avatar
whlspacedude whlspacedude is offline
Registered User
AKA: Will
FRC #1529 (Cyber Cards)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Indianapolis,Indiana 46227
Posts: 167
whlspacedude is just really nicewhlspacedude is just really nicewhlspacedude is just really nicewhlspacedude is just really nice
Send a message via AIM to whlspacedude Send a message via MSN to whlspacedude Send a message via Yahoo to whlspacedude
Re: WE NEED PGRM HELP

Thanks that really helped alot!!!!!!!!!!!!!!!

whlspacedude
__________________
Some people are like slinkies they are only good for 1 thing... pushing them down flights of stairs

1529 mph = 4 109 952 furlongs per fortnight
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
need help assembling parts in inventor .. (was: help) jhallel Inventor 5 22-02-2007 01:46
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46
HELP!! i need help starting a new team!! shyra1353 Starting New Teams 18 07-10-2003 17:55


All times are GMT -5. The time now is 00:22.

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