Demonstration Program for two servo motors
magicmetal
Posts: 3
I am not a programmer. Four years ago I built a simple servo motor demo board for my art students using a BASIC STAMP 2 and a UNL2803A ic to drive TWO small mitsumi motors. At the time I downloaded some code that made the motors rotate back and forth and then repeat the motion over and over again. I no longer have that code. Could anyone either write me a simple sketch or direct me to a site that has some sample code that I could download. Here is an attachment with a image of my board.
Comments
For example this link shows how to control a servo using a pot with the basic stamp. Not quite what you are looking for, but perhaps better:
http://www.parallax.com/dl/docs/books/sw/exp/sw25.pdf
Also, the code inside this zip file off the internet archive of the CBA robot site:
http://web.archive.org/web/20060621075149/budgetbot.com/downloads/BS2e/CBA_Testing.zip
Contains the following test code for their basic stamp 2e, but it should be adaptable for your board:
'{$STAMP BS2e}
'{$PBASIC 2.5}
PulseWidth VAR Word
DO
FOR PulseWidth = 500 TO 1000 STEP 2
·· PULSOUT 12,PulseWidth
·· PULSOUT 13,PulseWidth
·· PAUSE 20
NEXT
FOR PulseWidth = 1000 TO 500 STEP 2
·· PULSOUT 12,PulseWidth
·· PULSOUT 13,PulseWidth
·· PAUSE 20
NEXT
LOOP
Post Edited (Martin_H) : 4/5/2010 11:31:19 AM GMT
·http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/stepper/List/0/SortField/4/ProductID/65/Default.aspx
Jim
so any code that would work with a BS2, two stepper motors and a uhl2803 ic would be greatly appreciated.
Thanks,
Ira
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen