Go Down

Topic: Potentiometer Controlled Motor with Feedback (Read 2545 times) previous topic - next topic

ash901226

well what you could do is to use what AWOL suggest, by using the map function. by mapping the speed to the differences between the 2 pot.

Quote

if (A>B)
{
  int Difference= A-B;
  int Speed= map(Difference,0,1023,0,MAX);
  analogWrite(Speedpin,Speed);
}
if (A<B)
{
  int Difference= B-A;
  int Speed= map(Difference,0,1023,0,MAX);
  analogWrite(Speedpin,Speed);
}



Betelgeuse150

Thanks! I was just about to figure this out, but looks like I don't need to now.

ash901226

well i think i just spoonfeed you all the answer... haha anyway please show me your progress if you ever did the project...

Betelgeuse150

It will be a few weeks before I get the motors, but I will be sure to post it when im done.

Go Up