see Position Encoding: Single Track Grey Codes
Source Code

Starting keyword:

Sequence

Distance between sensors: (enter ? to search)
pixel width height

Mask:

mask