Fixed some mistakes in encoder module
Optimization: direct GPIO in sensor module