View Single Post
  #51   Spotlight this post!  
Unread 17-03-2004, 13:20
Xufer's Avatar
Xufer Xufer is offline
8 Seasons and as stable as ever
AKA: Working, 2/4 degrees complete still schooling...
FRC #1740 (The Cyber Colonels)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Waterford, CT
Posts: 231
Xufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to beholdXufer is a splendid one to behold
Send a message via AIM to Xufer Send a message via MSN to Xufer Send a message via Yahoo to Xufer
Re: quick question: TIMERS

Code:
if (rc_dig_in18=1)	{

			if (cnttick < 34 )
			{ 
				pwm05 = 60;
  				 }
			if (cnttick > 35 )
			{ 
				pwm05 = 127;
  				 }
			if (cnttick < 30 )
			{ 
				pwm04 = 0;
  				 }
			if (cnttick < 32 )
			{ 
				pwm04 = 127;
  				 }
//raises arm up for 40 ticks 1 second(s) /\ /\

// drive motors from here on out \/  \/
			
			if (cnttick > 35 && cnttick < 90 ) 
			{ 
				pwm01 = 190;
  				 }

			if (cnttick > 35 && cnttick < 90 )
			{ 
				pwm02 = 190;
  				 }
			if (cnttick > 92  && cnttick <= 122)
			{
				pwm01 = 190;
			}

			if (cnttick > 92 && cnttick <= 122)
			{
				pwm02 = 53;
			}
			if (cnttick > 130 && cnttick < 160 )
			{ 
				pwm01 = 190;
  				 }

			if (cnttick > 130 &&  cnttick < 160)
			{ 
				pwm02 = 190;
  			 }
			if (cnttick > 163  && cnttick <= 183)
			{
				pwm01 = 190;
			}

			if (cnttick > 163 && cnttick <= 183)
			{
				pwm02 = 53;
			}
			if (cnttick > 223 && cnttick < 250 )
			{ 
				pwm01 = 190;
  				 }

			if (cnttick > 223 && cnttick < 250 )
			{ 
				pwm02 = 190;
  			 }
			if (cnttick > 255  && cnttick <= 275)
			{
				pwm01 = 190;
			}

			if (cnttick > 255 && cnttick <= 275)
			{
				pwm02 = 53;
			}

}

else {
			pwm01=210;
}
when i do it like that reguardless of the switch it always works like the switch is on even when its off.
__________________


If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.

Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy
Photonics, It's Your Future