Go to Post I do want to remind people: Safety glasses, adult supervision and don't let freshmen touch the robot. ::safety:: - rtfgnow [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
  #13   Spotlight this post!  
Unread 05-02-2004, 15:18
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,570
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: A few questions on programming the Control System

Here is how I would implement the code (from which you should be able to figure out how to implement your code with pointers)

Code:
void toggle_single_solenoid(unsigned char button, unsigned char *prev_button, unsigned char *relay_fwd)
{
   if (button && !prev_button)     //don't keep toggling if they hold the button
      *relay_fwd = !(*relay_fwd);

   *prev_button = button;
}
call it like this:
Code:
 toggle_single_solenoid(p1_sw_trig, &prev_p1_sw_trig, &relay1_fwd);
Remember to declare prev_p1_sw_trig and change the variables to whichever switches and relays you want.
 


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 23:17.

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