program for turning on sound without interrupting lights?
Macadaciouse
Posts: 16
I'd like an effect to play a message while still scrolling lights, anyone know how to run a subroutine without causing the lights to stop for the duration? My current code is below, however I'm fiarly sure the lights (dpdt relay on pin 15) will kick off when the subroutine turns on the ipod (pin 0)
[code]
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
HIGH 15
PAUSE 500
LOW 15
PAUSE 500
IF IN1 = 1 THEN GOSUB sound
sound:
HIGH 0
PAUSE 200
LOW 0
[code/]
[code]
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
HIGH 15
PAUSE 500
LOW 15
PAUSE 500
IF IN1 = 1 THEN GOSUB sound
sound:
HIGH 0
PAUSE 200
LOW 0
[code/]
Comments
www.parallax.com/Store/Accessories/Sound/tabid/164/ProductID/482/Default.aspx
As a co-processor it offloads sound generation and plays it concurrently with code running on your BS2. I'd advise a SoundPal if the coding on your BS2 will get any more elaborate than it is now.
-- Gordon
lable
A=A+1
if A & %1111 =0 then xor led
if A & %11111 =0 and in1=1 then xor sound.
goto lable.
I don't know basicstamps syntax so pseudo code.
And it does not extactly do what is done in above code.
& = BItwise AND