this is almost the some code of v1.0.0 with direct port manipulation, it give more speed to use high resolution angular encoders