atan2() function, the first input shoud be the x value, and the second one the y value. in your code, you put y first then x.
also, you shouldnt have to use the
rad2deg() func because you can just set the rotation in radians to the
rotation property of the arm (since it reads rotation in radians already)