Ball and Beam Project

Hi, I have an old ball and beam system which I should run for one of my classes in less than 2 weeks. It has an old DC motor and a potentiometer by which I want to control the direction of the beam via Arduino UNO. I have no clue how to make the DC motor get feedback from potenciometer and change its speed and direction in order to reach the setpoint I want through PID controlling. I'll be glad if you help me Thanks a lot

analogRead is the usual method of reading a pot value. You can then use map .

Shpaget: analogRead is the usual method of reading a pot value. You can then use map .

it can work for speed, but how about direction?

Divide the range in halves and use one half for one direction, the other for the opposite.