Rotation sensor for robotic arm?

Theoretically rotary pots could be used, but you'd need fairly precise ones and you'd probably have to do a custom calibration of the voltage output over at various points within the rotation arc. A better choice would be a rotary encoder, there are some libraries and examples on basic rotary encoder usage at the linked page.