PDA

View Full Version : Servo speed, from potentiometer



CipiCips
- 18th May 2011, 03:48
Hello

I am trying to find on web for some example of slowing down servo speed using potentiometer, but I cant find it.

I am using PIC 16f877A and I have a potentiometer connected on AN0 pin, and when I move potentiometer servo moves same. If I move potentiometer to one end very fast servo will go fast to, so how can I reduce that speed. I mean can I program it to move slower no metter how fast I rotate potentiometer ??


Thx

kellyseye
- 18th May 2011, 20:28
Add a small delay between the reading of the pot and the execution of the servo routine.

Archangel
- 20th May 2011, 08:26
Hello again,
So I am thinking . . . you get your adc result and store it into a variable . . . . call it smartie, just because I never liked using dummy.
So then give your pulseout variable a different name . . . say we call it value.
then use a for next loop
For value = 0 to smartie
pulseout pin value
pause 10
next value
Just my thoughts . . .