Quote:
|
Originally Posted by mightywombat
I'm still struggling with how to figure direction.... Any help?
|
I'm assuming you have an ISR coded already. Connect the signal pin not connected to the interrupt and ground to the signal and ground pins on digital input number 8. Your ISR will look like this:
Code:
volatile signed int distance = 0;
void Int_1_Handler()
{
//check the other encoder channel. you may have
//to switch the comparison value to 1 depending on
//the configuration.
if (rc_dig_in08 == 0)
{
distance++;
}
else
{
distance--;
}
}