Potentiometer controlling Servo
Moonman80
Posts: 4
We are trying to control a servo using a potentiometer and basic stamp but cannot find any Basic Stamp programming that would allow to do so. Any suggestions?
Comments
Then you can move the servo based on the RCTIME.
If you need more help with this, let us know.
Look in the Stamp help file under RCTIME. A sample circuit is shown there to allow the Stamp to read the position of the pot.
You'll have a value ranging from near zero to about 4000, with the components shown in the example, if I remember correctly. Don't forget to use a Word-sized variable.
Then look in the Help file under PULSOUT.When the pulsout value is 500, the servo will be at full rotation in one direction, when its 750, it will be centered and when its 1000, it will be full rotation in the other direction.
All your program has to do is read the pot, scale it to be between 500 and 1000 and send that value out with the PULSOUT command. The command has to resend its value every 20 mSec or so by having the program loop around again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
parallax.com/Portals/0/Downloads/docs/books/edu/wamv2_2.pdf
Page 153, activity #4 .... but I'd encourage you to read the entire book starting at the beginning if you are new to micro-controllers.
What size is your pot?
Is your servo standard or continuous rotation?
Did you get you components from a parallax kit or did you buy them elsewhere? (that'll help answer questions 1 and 2).
Did the previous suggestions help you enough or do you still need more info?