Go to Post Call it confidence, call it ego, call it what you want, but the fact of the matter is you need to be humble or someone will humble you. - Dan Richardson [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Spotlight this post!  
Unread 23-02-2005, 16:59
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Re: General Q's

I am going to be non-secretive(As most teams are) and share my code in the UserRoutines.c . I am going to just hook up a spike instead of a speed controller. I figure hardware editing is quicker than software editing in this case. This snippet comes from the Buttons to Relay mapping part. Enjoy!

/*---------- Buttons to Relays----------------------------------------------
*--------------------------------------------------------------------------
* This default code maps the joystick buttons to specific relay outputs.
* Relays 1 and 2 use lim it switches to stop the movement in one direction.
* The & used below is the C symbol for AND
*/
if (p2_sw_trig<>0) /*If the opposites trigger is down. */
{
} /*Do nothing.*/
else
{
relay1_rev = p1_sw_trig & rc_dig_in01; /* REV only if switch1 is not closed. */
}
relay1_rev = p1_sw_top & rc_dig_in02; /* REV only if switch2 is not closed. */
if (p1_sw_trig<>0) /*Same as above. */
{
}
else
{
relay1_fwd = p2_sw_trig & rc_dig_in03; /* FWD only if switch3 is not closed. */
}
relay2_rev = p2_sw_top & rc_dig_in04; /* REV only if switch4 is not closed. */
relay3_fwd = p3_sw_trig;
relay3_rev = p3_sw_top;
relay4_fwd = p4_sw_trig;
relay4_rev = p4_sw_top;
relay5_fwd = p1_sw_aux1;
relay5_rev = p1_sw_aux2;
relay6_fwd = p3_sw_aux1;
relay6_rev = p3_sw_aux2;
relay7_fwd = p4_sw_aux1;
relay7_rev = p4_sw_aux2;
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
relay8_rev = 0;

All it does is wire Port 1 joystick trigger to reverse on our arm and port 2 trigger to forward. If a trigger is already down then ingnore the new command. I have very little C experience, so I hope this code is valid.
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
 


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
General Dynamics? Mike Rush General Forum 1 31-01-2003 17:04
General Forum congestion archiver 2001 7 24-06-2002 03:32
general forum threads archiver 2001 8 23-06-2002 22:47
2 Useful Websites - And general tips and Ideas Robby O 3D Animation and Competition 0 13-01-2002 02:03


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

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