Shop OBEX P1 Docs P2 Docs Learn Events
Help with Bothservosthreeseconds.bs2 example. — Parallax Forums

Help with Bothservosthreeseconds.bs2 example.

Calvin K.Calvin K. Posts: 2
edited 2012-05-07 18:18 in Learn with BlocklyProp
Hello,

I was recently gifted a BOE-bot kit and I have very much enjoyed working through the activity book, however I have hit a bit of a stumble point.

The program example BothservosThreeSeconds.bs2 gives the code:

DEBUG "Program Running!"

counter VAR Byte

FOR counter = 1 TO 122

PULSOUT 13, 650
PULSOUT 12, 850
PAUSE 20
NEXT

FOR counter = 1 TO 122
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT

END

...which is supposed to make the two servos rotate in opposite directions and then change directions, however both servos will only rotate in the initial directions indefinitely and the debug console will continuously print "Program running!". I'm especially confused because if I omit one of the servos from the loops then the other will behave as it should. Can anyone offer some insight into what I'm doing wrong?

Comments

  • W9GFOW9GFO Posts: 4,010
    edited 2012-05-07 16:19
    Try a fresh set of batteries. The continuous printing of "Program running!" means that the Stamp is resetting. Which is an indication that the batteries are low.
  • Calvin K.Calvin K. Posts: 2
    edited 2012-05-07 18:18
    That was exactly it, Thank you so much!
Sign In or Register to comment.