View Single Post
  #10   Spotlight this post!  
Unread 08-03-2004, 19:36
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: problem with autonomous that has stumped all programmers so far

this is the meat of my code... as you can guess the drive motors are on pwms 15,16 and the inturpts incrment count.
Code:
/********************************************************
************jacobs autonoumus code....******************** 
*******************************************************/
  		relay8_fwd = !rc_dig_in18;  			// Power pump only if pressure switch is on. 
  		relay8_rev = 0;
//this start start it moving... ladies and gents start your engins
		if(count >= 0 && count < 2) {
 			pwm15 = 127 + 50;			//drive strait
			pwm16 = 127 + 50;			//drive strait
//turn to get the ball
	if(count> 12 && count < 14) {
		foward = 0;					//turn off correction algoritiom (cuz were turning duh)
 			pwm15 = 127 + 50;			//make right wheel turn fowards
			pwm16 = 127 - 50;			//make left wheel turn backwards
			pwm01 = 254;				//make arm go up
		}
		if(rc_dig_in16 == 1) { 				//make sure arm doesnt go to high!!!
			pwm01 = 127;
		}
//then we have to go strait slightly to get to the ball
		if(count > 14 && count < 16) {
 			pwm15 = 127 + 50;			//go foward
			pwm16 = 127 + 50;			//go foward
			relay3_fwd = 1;				//open the gripers...
			relay3_rev = 0;				//open the grpiers...
		}
//now turn to AND close the gippers to knock/grab ball off... combo move HI-YAH
		if(count > 18 && count < 23) {
 			pwm15 = 127 - 50;			//turn the other way
			pwm16 = 127 + 50;			//turn the other way
			relay3_fwd = 0;				//close grippers
			relay3_rev = 1;				//close grippers
			
		}

//NOW we shut down motors
	if(count > 24 && count < 100) {
 		pwm15 = 127;					//turn the other way
		pwm16 = 127;					//turn the other way
		}	
/***********************************************************
*******************end jacobs auton code****************** 
***********************************************************/
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"