Go to Post Trust me. I am a Clock after all. ;) - Elgin Clock [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 02-02-2008, 20:13
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Relay program?

Quote:
Originally Posted by team877 View Post
here is our code you asked for....
Code:
void operatorControl ( void )
{
	unsigned char x;

	while ( 1 )
	{
		SetPwm ( 2 , x ) ; //  We’re setting are variable to the motor we want it to measure
		if ( 125 < x && x < 129 ) 
		{ // We want this relay to engage between these speeds
			SetRelay ( 1 , 1 , 0 ) ;
		}
		else
		{ // And if not turn the relay off
			SetRelay ( 1 , 0 , 0 ) ;
		}
	}
}
I don't see anything that sets the value of x. Did you forget the line that reads the joystick value?

(Is there a reason you posted it as a Word document containing a picture, instead of just copying the text? I don't use Word, and it was inconvenient to convert your file to a readable form.)
  #2   Spotlight this post!  
Unread 04-02-2008, 00:53
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: Relay program?

the Setpwm (1, x) is a window that you put your variable in so "x" is set to the value of pwm 1
  #3   Spotlight this post!  
Unread 04-02-2008, 07:10
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Relay program?

Quote:
Originally Posted by team877 View Post
the Setpwm (1, x) is a window that you put your variable in so "x" is set to the value of pwm 1
Isn't it the other way around? As an output function, SetPwm( 1, x ) sets pwm 1 to the value of x. I'm not aware of a built-in way to read the present value of a pwm output using easyC.

So where in your program do you actually control the pwm output that you want to use as the trigger for your relay?
  #4   Spotlight this post!  
Unread 04-02-2008, 11:11
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Relay program?

Normal operation would be to:

1) Get the desired drive value from the driver--GetOIAInput()

2) Do your tests on when you want your relay to be active--if () else

3) Output your relay command--SetRelay()

4) Set your PWM Output--SetPWM()
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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
Instance relay Team_486 Programming 0 28-03-2007 09:56
Relay Commands Matt Krass Programming 6 18-02-2006 23:03
Relay Assignments MulletFish Programming 9 27-01-2005 14:15
Relay fault archiver 2000 2 23-06-2002 23:36
Relay Outputs OddOne Technical Discussion 3 01-02-2002 19:52


All times are GMT -5. The time now is 20:05.

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