Colton explains how to make an encoder using two optical distance sensors. The encoder in this video has 7 white and 7 black sections meaning it measures 28 times per revolution. See modernroboticsedu.com for code.
No download links available.