 				if ( timeDiff < CWCCWDriftTimeLimit && direction != 0 )
 				{
 					// we get a CW/CCW in less then a very short time, let's check if the current direction is identical with the previous direction
+
 					if ( prevEncoderDirection[encoderId] != direction && prevEncoderDirection[encoderId] != 0 )
 					{
 						//the current direction is different with the previous one, let's use the previous direction instead

		PORTA = ~( B00000001 << rowid);

		//we must have such a delay so the digital pin output can go LOW steadily, 
		//without this delay, the row PIN will not 100% at LOW during yet,
		//so check the first column pin's value will return incorrect result.
		delayMicroseconds(3);

		byte colResult[16];

			//pin 38, PD7
			colResult[0] = (PIND & B10000000 )== 0 ? 1 : 0;
			//pin 39, PG2
			colResult[1] = (PING & B00000100 )== 0 ? 1 : 0;
			//pin 40, PG1
			colResult[2] = (PING & B00000010 )== 0 ? 1 : 0;
			//pin 41, PG0
			colResult[3] = (PING & B00000001 )== 0 ? 1 : 0;

			//pin 42, PL7
			colResult[4] = (PINL & B10000000 )== 0 ? 1 : 0;
			//pin 43, PL6
			colResult[5] = (PINL & B01000000 )== 0 ? 1 : 0;
			//pin 44, PL5
			colResult[6] = (PINL & B00100000 )== 0 ? 1 : 0;
			//pin 45, PL4
			colResult[7] = (PINL & B00010000 )== 0 ? 1 : 0;

			//pin 46, PL3
			colResult[8] = (PINL & B00001000 )== 0 ? 1 : 0;
			//pin 47, PL2
			colResult[9] = (PINL & B00000100 )== 0 ? 1 : 0;
			//pin 48, PL1
			colResult[10] =( PINL & B00000010)== 0 ? 1 : 0;
			//pin 49, PL0
			colResult[11] =( PINL & B00000001)== 0 ? 1 : 0;

			//pin 50, PB3
			colResult[12] =( PINB & B00001000)== 0 ? 1 : 0;
			//pin 51, PB2
			colResult[13] =( PINB & B00000100)== 0 ? 1 : 0;
			//pin 52, PB1
			colResult[14] =( PINB & B00000010)== 0 ? 1 : 0;
			//pin 53, PB0
			colResult[15] =( PINB & B00000001)== 0 ? 1 : 0;


		for ( int colid = 0; colid < 16; colid += 2 )
		{

		//joyReport.axis[ind] = map(analogRead(54+ind), 0, 1023, -32768,32767 );
	}
	sendJoyReport(&joyReport);
//	delay(20);
}
