unmodified servo and bs2-sx
ferretonthelus
Posts: 9
ok, first I do not have the board of education, just a simple perf board with pin to pin connections to male header. 5volt regulator, power led, and reset button (momentary, n/o). ·now I just need a simple program to move my servo center, right, left. so far because of the speed (i guess) i have not been able to find even the simplest code (without the BOE) to adddress this. It seems to be different than the PIC's i have programmed with, mostly in being simpler. maybe to simple . But if anyone can help the newbie (me) get this jumpstarted I would be greatly in your debt. Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ferrets are funny little animals
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ferrets are funny little animals
Comments
Not having the BOE makes no difference. All you need to do is send a pulse of the correct width to the servo. A pulse of 1500uS or so should center the servo, a pulse of 2000uS should make it go to the far end one way, and a pulse of 1000uS should make it go to the far end the other way. With the Basic Stamp, the command to use is PULSOUT, like this:
main:
PULSOUT ServoPin, pulseLength
pause 20
goto main
I do not know what Stamp you are using, and different Stamps have different PULSOUT resolutions. Check the docs for the one you are using. For example, the BS2 has a 2uS resolution. So, to send a pulse of 1500uS (to center the servos) you would use:
PULSOUT servoPin, 750
HTH,
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ferrets are funny little animals
Quite right, you did mention the SX in the subject. Not enough coffee
The B2sx has a PULSOUT resolution of .8uS. So, to set the servo to ~ center, try a PULSOUT value of 1875.
HTH,
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ferrets are funny little animals