Greetings,
I am trying to set up some reference encoder for my team. We are using MPLAB with Vex Controller.
Is there a way that I can get the interrupt to be triggered on the raising or falling edge of the resulting encoder square wave?
Right now my code (below) just looks to see if the signal is high (0) or low (1), but if the encoder happens to stop when the signal is high , the encoder count just runs.
Code:
if(rc_dig_int1)
{
encoder1++;
PORTBbits.RB2=0; //Set Interrupt = 0
}
Thanks