Paying someone $50 to write a beginner level code for a DIY project.

I think you need a sensor to read the angular position.