View Single Post
  #5   Spotlight this post!  
Unread 16-02-2004, 21:09
Ryan Cumings's Avatar
Ryan Cumings Ryan Cumings is offline
Programmer and University Rejected
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Pembroke, NH
Posts: 65
Ryan Cumings is an unknown quantity at this point
Send a message via AIM to Ryan Cumings
Re: Autonomous Program Names

I decided to let a crazy German run amok in my code this year.. It beats the mute from last year that didn't explain anything at all
Code:
void normalize_motors(unsigned char left, unsigned char right) {
		// Vait!! Dat's der vrong direction
		// -- Inverse the polarity if required
	left = (INVERT_LEFT ? 255 - left : left);
	right = (INVERT_RIGHT ? 255 - right : right);

		// Vut da hell ist up wiv dat der blinkin lighten
		// -- Keep the controller from resting by stopping the magic word
	left = (left == 255 ? 254 : left);
	right = (right == 255 ? 254 : right);

		// Vee vill tell das utters vhere vee vent
		// -- Keep this information, it may be useful
	left_reverse = (left < 127 ? -1 : 1);
	right_reverse = (right < 127 ? -1 : 1);

		// Und zee motors spin vround und vround
		// -- Final output goes to motors
	Generate_Pwms( 127, 127, left, right);
	LEFT_MOTOR = right;
	RIGHT_MOTOR = right;
}
__________________
Suddenly being rejected from college feels right during the build season. Now I am a mentor.