|
Re: Gear Tooth Sensor
Our code looks something like this for Encoder 1 and 2
void Encoder_1_Int_Handler(void)
{
// Encoder 1'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.
if(ENCODER_1_PHASE_B_PIN == 0)
{
Encoder_1_Count += ENCODER_1_TICK_DELTA;
}
}
#endif
#ifdef ENABLE_ENCODER_2
Would this work or not?
P.S. If I take away the #ifdef ENABLE_ENCODER_3 from the correct intrrupt would that correctly disable ENCODERS 3 -6. If not was would be the correct way for doing this.
Last edited by Ultima : 16-01-2007 at 15:34.
Reason: Clarification
|