sound pal
cplatt
Posts: 55
I am having no luck getting my soundpal to work...put it on the servo headers, BOE switch to 2 and this is my code. Could someone make a suggestion? Are my bauds wrong? Thank you!
' {$STAMP BS2p}
' {$PBASIC 2.5}
iopin PIN 14 'Pin number used for communicaiton with SoundPAL.
baud CON $8000 + 240 'Communication baudrate is 9600 for BS2p.
reset CON $8000 + 2063 'Reset baudrate is 1200 for BS2p.
'----Reset the SoundPAL
DoReset:
DO:LOOP UNTIL iopin 'Make sure SoundPAL is powered up.
SEROUT iopin, reset, [0] 'Output 9 low bits at 1200 baud (i.e. a 7.5ms pulse).
RETURN
' {$STAMP BS2p}
' {$PBASIC 2.5}
iopin PIN 14 'Pin number used for communicaiton with SoundPAL.
baud CON $8000 + 240 'Communication baudrate is 9600 for BS2p.
reset CON $8000 + 2063 'Reset baudrate is 1200 for BS2p.
'----Reset the SoundPAL
DoReset:
DO:LOOP UNTIL iopin 'Make sure SoundPAL is powered up.
SEROUT iopin, reset, [0] 'Output 9 low bits at 1200 baud (i.e. a 7.5ms pulse).
RETURN
Comments
-Phil
As to changing the volume level, no, that can't be done. The SoundPAL has one volume level: loud. However, you can simulate the effect of different volumes by adjusting the style and duration of the notes you play. For example, notes played staccato with rests in between will be less noticeable than those played legato with no rests.
-Phil