Will this code work in a BS1
studiomagic1
Posts: 25
counter VAR Word
' ' '' ' '' ' ' before eyes move dead pin for 30 second delay ' ' '' ' '' ' '' ' '
FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
GOTO Main:
Main:
DO
IF IN2 = 1 THEN
GOTO Blink1:
ENDIF
IF IN4 = 1 THEN·
GOTO Blink2:
ENDIF
IF IN1 = 1 THEN
GOTO Blink3:
ENDIF
LOOP
' ' '' ' '' ' 'pushbutton ' '' ' '' ' '' ' '
· Blink2:
FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 15
·PULSOUT 12, 415
·PAUSE 15
·NEXT
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 14
·PULSOUT 12, 840
·PAUSE 14
NEXT
GOTO Main:
··· Blink1:·· ''''''Starting routine
··· PAUSE 20000
FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 8
NEXT
PAUSE 2000
FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 10
·PULSOUT 12, 415
·PAUSE 10
·NEXT
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 10
NEXT
FOR counter = 1 TO 15
PULSOUT 13, 690
·PAUSE 10
·PULSOUT 12, 415
·PAUSE 10
·NEXT
· FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 20
·PULSOUT 12, 840
·PAUSE 20
NEXT
·PAUSE 2500
FOR counter = 1 TO 15
PULSOUT 13, 690
·PAUSE 8
·PULSOUT 12, 415
·PAUSE 8
·NEXT
·FOR counter = 1 TO 10
·PULSOUT 13, 375
·PAUSE 7
·PULSOUT 12, 840
·PAUSE 9
NEXT
GOTO Main:
Blink3: ''''''ending
·PAUSE 5000
·FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
·PAUSE 10000
·FOR counter = 1 TO 10
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 5
NEXT
·PAUSE 3000
· FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
·PAUSE 4000
FOR counter = 1 TO 10
·PULSOUT 12, 840
·PAUSE 15
·NEXT
·PAUSE 1000
·FOR counter = 1 TO 15
·PULSOUT 12, 415
·PAUSE 20
·NEXT
·PAUSE 4000
FOR counter = 1 TO 10
PULSOUT 13, 300
·PAUSE 15
·NEXT
·PAUSE 1000
·FOR counter = 1 TO 15
·PULSOUT 13, 690
·PAUSE 20
·NEXT
·PAUSE 4000
·FOR counter = 1 TO 10
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 5
NEXT
PAUSE 5000
· FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
·PAUSE 4000
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 8
NEXT
PAUSE 3000
FOR counter = 1 TO 15
·PULSOUT 13, 690
·PAUSE 5
·NEXT
PAUSE 500
·FOR counter = 1 TO 10
PULSOUT 13, 300
·PAUSE 5
·NEXT
PAUSE 2000
·FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 15
·PULSOUT 12, 415
·PAUSE 15
·NEXT
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 14
·PULSOUT 12, 840
·PAUSE 14
NEXT
FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 15
·PULSOUT 12, 415
·PAUSE 15
·NEXT
·GOTO Main:
' ' '' ' '' ' ' before eyes move dead pin for 30 second delay ' ' '' ' '' ' '' ' '
FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
GOTO Main:
Main:
DO
IF IN2 = 1 THEN
GOTO Blink1:
ENDIF
IF IN4 = 1 THEN·
GOTO Blink2:
ENDIF
IF IN1 = 1 THEN
GOTO Blink3:
ENDIF
LOOP
' ' '' ' '' ' 'pushbutton ' '' ' '' ' '' ' '
· Blink2:
FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 15
·PULSOUT 12, 415
·PAUSE 15
·NEXT
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 14
·PULSOUT 12, 840
·PAUSE 14
NEXT
GOTO Main:
··· Blink1:·· ''''''Starting routine
··· PAUSE 20000
FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 8
NEXT
PAUSE 2000
FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 10
·PULSOUT 12, 415
·PAUSE 10
·NEXT
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 10
NEXT
FOR counter = 1 TO 15
PULSOUT 13, 690
·PAUSE 10
·PULSOUT 12, 415
·PAUSE 10
·NEXT
· FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 20
·PULSOUT 12, 840
·PAUSE 20
NEXT
·PAUSE 2500
FOR counter = 1 TO 15
PULSOUT 13, 690
·PAUSE 8
·PULSOUT 12, 415
·PAUSE 8
·NEXT
·FOR counter = 1 TO 10
·PULSOUT 13, 375
·PAUSE 7
·PULSOUT 12, 840
·PAUSE 9
NEXT
GOTO Main:
Blink3: ''''''ending
·PAUSE 5000
·FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
·PAUSE 10000
·FOR counter = 1 TO 10
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 5
NEXT
·PAUSE 3000
· FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
·PAUSE 4000
FOR counter = 1 TO 10
·PULSOUT 12, 840
·PAUSE 15
·NEXT
·PAUSE 1000
·FOR counter = 1 TO 15
·PULSOUT 12, 415
·PAUSE 20
·NEXT
·PAUSE 4000
FOR counter = 1 TO 10
PULSOUT 13, 300
·PAUSE 15
·NEXT
·PAUSE 1000
·FOR counter = 1 TO 15
·PULSOUT 13, 690
·PAUSE 20
·NEXT
·PAUSE 4000
·FOR counter = 1 TO 10
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 5
NEXT
PAUSE 5000
· FOR counter = 1 TO 20
PULSOUT 13, 690
·PAUSE 5
·PULSOUT 12, 415
·PAUSE 5
·NEXT
·PAUSE 4000
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 10
·PULSOUT 12, 840
·PAUSE 8
NEXT
PAUSE 3000
FOR counter = 1 TO 15
·PULSOUT 13, 690
·PAUSE 5
·NEXT
PAUSE 500
·FOR counter = 1 TO 10
PULSOUT 13, 300
·PAUSE 5
·NEXT
PAUSE 2000
·FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 15
·PULSOUT 12, 415
·PAUSE 15
·NEXT
·FOR counter = 1 TO 15
·PULSOUT 13, 300
·PAUSE 14
·PULSOUT 12, 840
·PAUSE 14
NEXT
FOR counter = 1 TO 10
PULSOUT 13, 690
·PAUSE 15
·PULSOUT 12, 415
·PAUSE 15
·NEXT
·GOTO Main:
Comments
You can produce both servo pulses, one after the other, then pause for 20ms so you get around 50 pulses per second.
The BS1 does have a relatively small limit on the number of GOSUBs allowed.· Check the·manual for that.· It may be a limiting factor as well as memory size.
http://www.efx-tek.com/downloads/prop-1_programming_basics.pdf
Also the BS1 doesn't support DO..Loop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!