Shop OBEX P1 Docs P2 Docs Learn Events
Controlling two servos with two potentiometers, bs2 — Parallax Forums

Controlling two servos with two potentiometers, bs2

josue593josue593 Posts: 1
edited 2011-10-21 09:56 in BASIC Stamp
Hi,

I'm trying to develop a robotic arm actioned by two servos, which are controlled each one by one potentiometer. I was able to controll one servo with just one potentiometer, using RCTIME, to monitor the position of the potentiometer and transmit this info to positioning the servo. But when I want to connect the other servo I can't move it, cause I dont know how to program the BASIC Stamp, to read the signals from the two potentiometers separetly, but both at the same time. And move servos both at the same time but from different signals out of each potentiometer.

If someone could help me giving me directions how to make the BS2 read the two potentiometers and move the two servos at the same time, I would aprreciatte it very much.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-21 09:56
    You can't read the two potentiometer values at the "same time". You can read one, then read the other in rapid succession so it seems like you're reading them at the same time. Just do two RCTIME statements, one for one potentiometer and the second for the other using different variables and I/O pin numbers. Similarly, you can't move the two servos at exactly the same time, but you can output the control pulse for one servo, then do the same thing for the other servo and it will seem like they're both moving at the same time.

    For examples of moving two servos at the same time, look at the "Robotics with the BoeBot" tutorial. Go to the main Parallax webpage and click on the "Downloads" button. On the Downloads page, click on the "Educational Tutorials and Translations" button and you'll see the list of tutorials.
Sign In or Register to comment.