View Single Post
  #7   Spotlight this post!  
Unread 11-01-2008, 01:12
comphappy comphappy is offline
Registered User
AKA: Brennan Ashton
FRC #2605 (A2D_16)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Bellingham, WA
Posts: 157
comphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to behold
Send a message via AIM to comphappy
Re: New C18 3.0+ Compatible FRC Code

I am trying to figure out the encoder code, and do not understand how the code knows what way the shaft is turning,
void Int_1_ISR(void)
{
if(ENCODER_1_PHASE_B_PIN == 0)
{
Encoder_1_Count -= ENCODER_1_TICK_DELTA;
}
else
{
Encoder_1_Count += ENCODER_1_TICK_DELTA;
}
}

What really is ENCODER_1_PHASE_B_PIN?
And what port is this interrupt running one Input 1 or 2?

Last edited by comphappy : 11-01-2008 at 01:14.