Go Down

Topic: Potentiometer Controlled Motor with Feedback (Read 2715 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);
}



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...

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy