Shop OBEX P1 Docs P2 Docs Learn Events
servo positons — Parallax Forums

servo positons

izbin88izbin88 Posts: 4
edited 2012-01-15 20:00 in BASIC Stamp
I'm doing the slowServoSignalForLed.bs2 program in the what's a microcontroller book. here is the code

'What's a microcontroller - SlowSignalForLed.bs2
'Slow down the servo signals to 1/10 speed so that we can see
'the Led indicator blink on/off.


' {$STAMP BS2}
' {$PBASIC 2.5}


counter VAR Word


FOR counter = 1 TO 15
PULSOUT 14 , 800
PAUSE 200
NEXT



When I run the code sometimes the servo jerks back and forth around the "800" position. Is this supposed to happen?

Comments

  • ercoerco Posts: 20,256
    edited 2012-01-14 19:47
    Use "pause 20", not 200.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-15 20:00
    Copy the code from the book exactly, and try again. As it says in the text, both PULSOUT and PAUSE are increased by a factor of 10. You can then experiment with other settings; e.g. 8000 for 800, etc.

    BTW, this might not work with all servos. It should be okay with Parallax (Futaba) servos. Other brands? No telling.

    In any case, though, it's just an exercise in watching the servo move slowly. You wouldn't really do it this way other than a simple demo.

    -- Gordon
Sign In or Register to comment.