how rotary encoder works and how to use it arduino how rotary encoder works and how to use it arduino howtomechatronics