View Single Post
  #11   Spotlight this post!  
Unread 17-02-2004, 00:30
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Autonomous Program Names

I wrote this compressor control code after playing a few too many Zelda games. My students found it very amusing and it is actually in the robot (and works quite well, debounce helps).

Code:
/*******************************************************************************
* FUNCTION NAME: Magic_Wind
* PURPOSE: Creates magic wind (air pressure) to blow into (confidential info  edited out) of the robot.  
*			Minimizes rapid wind changes (debounces).
* CALLED FROM: Process_Data_From_Master_uP 
* PARAMETERS: none  
* RETURNS: void 
*******************************************************************************/
//constants
#define Change_in_Wind	15
//aliases
#define Rumble_Pak	relay1_fwd //compressor (until fuse blows)
#define Rumble_Gnd	relay1_rev //compressor (always 0, unless 
			               //I choose to decompress the bot)
#define Wind_Waker	rc_dig_in18 //pressure switch
//global var
unsigned char Old_Wind_Waker = 1;
unsigned char Wind_Timer = Change_in_Wind;

void Magic_Wind()
{
	if (Wind_Timer == Change_in_Wind)
		Rumble_Pak = !Wind_Waker;
	else if (Wind_Timer < Change_in_Wind)
		Wind_Timer++;

	if (Wind_Waker != Old_Wind_Waker)
		Wind_Timer = 0;
	Rumble_Gnd = 0;
	Old_Wind_Waker = Wind_Waker; 
}
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 17-02-2004 at 00:34.