Shop OBEX P1 Docs P2 Docs Learn Events
Lego compatible servo can drive wheels from a Stamp — Parallax Forums

Lego compatible servo can drive wheels from a Stamp

Hello!
Okay I built this thing out of Lego and one of the brown dog's servos.

I am adapting this code:

' RotateParallaxCrServo.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}

counter VAR Word
servoPin PIN 15             ' change I/O pin for servo signal here

 Fward:
FOR counter = 1 TO 100      ' Rotate counterclockwise for ~3 seconds

  PULSOUT servoPin, 850
  PAUSE 20

NEXT

FOR counter = 1 TO 100      ' Hold still for ~3 seconds

  PULSOUT servoPin, 900

  PAUSE 20

NEXT

 FOR counter = 1 TO 100      ' Rotate clockwise for ~3 seconds

  PULSOUT servoPin, 900
  PAUSE 20

NEXT

GOTO Fward

So of course it runs but, ah, I'm not completely sure of what the servo is doing when running. Incidentally that thing is one of two from this discussion:
https://tinyurl.com/46p4dzpr

It is certainly a starter.
Oh and the mascots are watching it run.

Sign In or Register to comment.