View Single Post
  #6   Spotlight this post!  
Unread 20-02-2007, 08:41
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: Gear Tooh phase B? help?

Quote:
Originally Posted by Ianuser View Post
Code:
void Encoder_2_Int_Handler1(void)
{
	// Encoder 2's phase a signal just transitioned from zero to one, causing 
	// this interrupt service routine to be called. We know that the encoder 
	// just rotated one count or "tick" so now check the logical state of the 
	// phase b signal to determine which way the the encoder shaft rotated.

	Encoder_22_Count += ENCODER_2_TICK_DELTA;
}
#endif

#ifdef ENABLE_ENCODER_3

?
I don't know where the "_22_" came from, but the logic (such as it is) is correct. However, I was hoping you'd also think to correct the comment to explain what you did and why you did it. Someone (perhaps you) is going to be reading this code later, and it will help to have comments that actually describe the code.