Thread: Relay program?
View Single Post
  #9   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,112
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.)