bs2sx wont stop
churd
Posts: 9
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
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
·· 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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
One step ahead of me, I added a separate power supply for the servo, and that solved the problem.