How to use/code for a potentiometer
apmorgan93
Posts: 1
In my class we are learning how to program using the basic stamp. Last week we made a loop to control 2 servos to drive the chip around in a rectangle. Well I loaned one out and took it home to experiment with. I'd like to make something where I use a potentiometer to control the angle of the servo. I've spent a few hours googling and scouring the internet for how to go about doing this or how to even code for a potentiometer and I've found absolutely nothing useful pertaining to the basic stamp. Can someone please help me or give me links to where I can learn how to do this?
Comments
Another good source: Robotics With the Boe Bot
EDIT: I would also like to point out that the Basic Stamp forum is the best place to post questions about Stamps. It is also a great resource for finding info on problems, projects, etc. that others have had.
If you are working with a Boe-Bot robot, you have continuous rotation servos. The code from What's a Microcontroller (ControlServoWithPot.bs2) would not give the same results as it would with a standard servo.
For continuous rotation servos, the pulses tell it to rotate at a certain speed and direction. The only way to get it to hold a certain position is to know how long it would take to rotate to that angle, and then stop sending pulses. It would not be able to resist a force trying to twist it away from that position.