Shop OBEX P1 Docs P2 Docs Learn Events
bs2sx wont stop — Parallax Forums

bs2sx wont stop

churdchurd Posts: 9
edited 2007-03-06 18:41 in Learn with BlocklyProp
I'm new to the bs2sx, and feel pretty confident with pbasic, but here's a weird one. If I run the following code, the program continues as if it is looping through with a short pause. This happens even with a stop or an end. Any ideas?

PAUSE 1000 'Wait to execute
FOR I =1 TO 100 'The amt of time the servo holds that position
PULSOUT 1, 600 'Turn servo CCW to end
PAUSE 20 'Necessary servo pause
NEXT

FOR J =1 TO 100 'The amt of time the servo holds that position
PULSOUT 1, 1800 'Turn servo CW to middle
PAUSE 20 'Necessary servo pause
NEXT
STOP 'or END

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-06 15:14
    Hello,

    ·· Add the following line to the beginning of your program…It will tell you if the program is restarting (if it prints more than once) which could be a symptom of a brownout condition. Your batteries may be low. Take care.

    DEBUG "PROGRAM RUNNING", CR
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • churdchurd Posts: 9
    edited 2007-03-06 18:41
    Thanks Chris!

    One step ahead of me, I added a separate power supply for the servo, and that solved the problem.
Sign In or Register to comment.