basic code to read a digital encoder which
at this point seems to actually work.