Connecting a brushless motor with hall sensors and position encoder to arduino