Gray code is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit). They're commonly used for hardware controllers like rotary encoders to avoid misreading transitions between binary values since each successive Gray code only differs by one digit.
https://en.wikipedia.org/wiki/Gray_code