Pages: 1 [2]   Go Down
Author Topic: Potentiometer Controlled Motor with Feedback  (Read 2245 times)
0 Members and 2 Guests are viewing this topic.
Malaysia
Offline Offline
Sr. Member
****
Karma: 7
Posts: 393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Malaysia
Offline Offline
Sr. Member
****
Karma: 7
Posts: 393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: 1 [2]   Go Up
Jump to: