Go to Post Its easier to solve a problem when you have a positive attitude about it. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Control System
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
  #17   Spotlight this post!  
Unread 08-02-2004, 11:42
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
Re: A few questions on programming the Control System

Quote:
Originally Posted by Avarik
Alright, I finally figured it out! Here is how I did it.

Code:
if (p1_sw_trig && rel1==0)
{

	rel1++;
	if (rel2==0)
	{
	relay1_fwd=1;
	rel2++;
	}
	else
	{		
	relay1_rev=1;
	rel2--;
	}
						
}

if (!p1_sw_trig)
{
	rel1=0;
	relay1_fwd=0;
	relay1_rev=0;
}

rel1 and rel2 are simply declared as ints, where rel1 is initialized to 0, and rel2 to 1. This makes it go forward at first, then backwards the next time.
Essentially my method.
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
 


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
What do you wish you knew about the new control system? Joe Ross Control System 2 09-01-2004 21:47
Need a FIRST Robotics control system kershawrobotics General Forum 3 07-07-2003 09:49
control system worth more than $500 archiver 2001 8 24-06-2002 02:00
control system programming archiver 2000 17 23-06-2002 22:14
Ok, how much is the control system worth? archiver 2001 6 23-06-2002 22:05


All times are GMT -5. The time now is 07:11.

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