What have you done so far? What do you understand about the Stamp 1? Do you understand how servos work?
Typically, a servo expects a pulse approximately every 20ms with a width between 1ms and 2ms with 1ms representing one end of the range of movement and 2ms representing the other end. With 2 servos, you could put out 2 separate pulses of differing widths if you want, as long as the pulses occur at least every 20ms. With the BS1, you would use a PULSOUT statement for each servo with the period (in 10us units) either 1ms or 1.5ms (for the two positions). You may have to adjust these pulse widths to get the movement you want, but this is a good starting point. After sending the two pulses, you'd need a PAUSE of maybe 16-18ms, then repeat. A wait of about 15 seconds would be 50*15=750 cycles approximately (you can adjust that as needed).
If you haven't looked at it yet, you should get a download copy of "What's a Microcontroller?" from Parallax's website.
I have used servos and the stamp before. But makeing a servo move spin to half way then wait and then spin back to 0 again is something I have really never gotten a straight answer on. I am a visual learner, what would a code look like, to help me get started. Thanks for the help
For 2 servos, you'd just add a second PULSOUT to each loop and shorten the PAUSE slightly to compensate. Again, for 15 seconds approximately, you'd want the first loop to execute about 750 times (roughly). The second loop should execute until you're ready to start over again like:
COUNTER VAR Word
FOR COUNTER = 1 TO 750 ' this should take about 15 seconds
PULSOUT 12, 150 ' 150 * 10us = 1.5ms (adjust as needed)
PULSOUT 13, 150 ' the same (or different) value
PAUSE 18
NEXT
DO ' *** repeat forever ***
PULSOUT 12, 100 ' 100 * 10us = 1.0ms (adjust as needed)
PULSOUT 13, 100 ' the same (or different) value
PAUSE 18
LOOP
I cant get the program to work with the " COUNTER VAR word command in the beginning, isnt that supposed to be B1 or some syntax, how should I change this to make the program work? Thanks soo much
Comments
Typically, a servo expects a pulse approximately every 20ms with a width between 1ms and 2ms with 1ms representing one end of the range of movement and 2ms representing the other end. With 2 servos, you could put out 2 separate pulses of differing widths if you want, as long as the pulses occur at least every 20ms. With the BS1, you would use a PULSOUT statement for each servo with the period (in 10us units) either 1ms or 1.5ms (for the two positions). You may have to adjust these pulse widths to get the movement you want, but this is a good starting point. After sending the two pulses, you'd need a PAUSE of maybe 16-18ms, then repeat. A wait of about 15 seconds would be 50*15=750 cycles approximately (you can adjust that as needed).
If you haven't looked at it yet, you should get a download copy of "What's a Microcontroller?" from Parallax's website.