You have a disc. One half of the disc is painted white and the other half is black. The disc rotates in either a clockwise direction or an anti-clockwise direction.
There are two sensors which are not connected to the disc but are in a fixed position, pointed at the disc. They are at 90° from each other with respect to the center of the disc. The sensors output the value
1 when reading white and
0 when reading black.
Using only the output of the two sensors, find the direction in which the disc is rotating.