Found this encoder .. looks very useful for my current project . has Bi colour led and push switch... from uk supplier hobbytronics.com ( top is extra ) drawback has no threaded collar , so board will have to be mounted ..
Think it from sparkfun https://www.hobbytronics.co.uk/rotary-encoder-rg
I have a very similar one but without the LED. For encodeing the outputs I used a simple lookup table.
This is Arduino code. It makes a 16 bit number from the last states and the new states. Might be useful.
Code:
const int8_t lookup_table[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};
rotateState<<=2;
if(digitalRead(A0))
rotateState+=1;
if(digitalRead(A1))
rotateState+=2;
rotateState&=15;
number+=lookup_table[rotateState];
// keep in the range 0 to 19999
if(number>32767)
number=19999;
else if(number>19999)
number=0;