Go to Post My suggestion is to first focus in on your drive base. Get it running, and drive it into the ground and see what breaks. Then fix it. Rinse wash and repeat. - Andy A. [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
  #32   Spotlight this post!  
Unread 23-01-2008, 00:06
Jim E Jim E is offline
Registered User
FRC #1523 (M.A.R.S.)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Lantana, FL
Posts: 188
Jim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond reputeJim E has a reputation beyond repute
Re: A New Programmer

Hi,

You can try this, but I don't make any guarantee.

Toggle_gripper(current state)
{
int temp_state;
If ((p3_sw_trig==TRUE)&&( current _state== CLOSED)
temp_state=current_state;

else if (p3_sw_trig==TRUE)
temp_state=OPEN;

else if ((p3_sw_trig==FALSE)&&(current_state==OPEN))
temp_state=current_state;

else if ((p3_sw_trig==FALSE)
temp_state=CLOSED;

} return (temp_state);

In you Default _Routine, simply call the function:


pwm_state=Toggle_Gripper(current_pwm);
if (current_pwm<>pwm_state)
pwm=pwm_state;

I'm writing this off the cuff, you will need to correct the syntax and apply your own values for the pwm assignments, but it looks plausable. Good luck.
__________________
Team MARS = 1.523 AU from the SUN!

Jim E.
 


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
NEW PROGRAMMER!!!!! NEED HELP!!!! delphi demon Programming 5 19-04-2007 13:22
pic: Team 1249's new programmer roborat Extra Discussion 4 23-06-2006 22:02
Senior Programmer: advice on training new recruits Jeff_Rice Programming 9 04-01-2005 16:59
Help for New Programmer Mike375 Programming 3 27-09-2001 09:04


All times are GMT -5. The time now is 13:10.

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