Cheap sensor for angular rotation (not rotation rate)

Credit where its due - its not GREY code
The reflected binary code (RBC), also known just as reflected binary (RB) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit).