If you don't mind to do simple simple circuit like :
http://www.mindspring.com/~tom2000/Delphi/Quad_Decoder_4013.gifThat way the Direction decode done by hardware
1. Let's name each output as : 'Negative' and 'Positive' respectively
2. Let's name each set (encoder+circuit) as :
a. Yaw
b. Pitch
c. Roll
3. Use of PinChangeInt
4. Here is what in my mind
#include <PinChangeInt.h>
#define PinYawPos 3
#define PinYawNeg 4
#define PinPitchPos 6
#define PinPitchNeg 7
#define PinRollPos 6
#define PinRollNeg 7
void setup() {
pinMode(PinYawPos, INPUT);
digitalWrite(PinYawPos, HIGH);
PCintPort::attachInterrupt(PinYawPos, YawPos, CHANGE);
pinMode(PinYawNeg, INPUT);
digitalWrite(PinYawNeg, HIGH);
PCintPort::attachInterrupt(PinYawNeg, YawNeg, CHANGE);
pinMode(PinPitchPos, INPUT);
digitalWrite(PinPitchPos, HIGH);
PCintPort::attachInterrupt(PinPitchPos, PitchPos, CHANGE);
pinMode(PinPitchNeg, INPUT);
digitalWrite(PinPitchNeg, HIGH);
PCintPort::attachInterrupt(PinPitchNeg, PitchNeg, CHANGE);
pinMode(PinRollPos, INPUT);
digitalWrite(PinRollPos, HIGH);
PCintPort::attachInterrupt(PinRollPos, RollPos, CHANGE);
pinMode(PinRollNeg, INPUT);
digitalWrite(PinRollNeg, HIGH);
PCintPort::attachInterrupt(PinRollNeg, RollNeg, CHANGE);
Serial.begin(115200);
Serial.println("Yaw Pitch Roll");
}
void loop(){}
void YawPos(){
Serial.println("Y+");
}
void YawNeg(){
Serial.println("Y-");
}
void PitchPos(){
Serial.println("P+");
}
void PitchNeg(){
Serial.println("P-");
}
void RollPos(){
Serial.println("R+");
}
void RollNeg(){
Serial.println("R-");
}