serial LCD with piezo speaker
pdug
Posts: 2
I am using Basic Stamp 2 with board of education and a serial LCD #27977. My issue is that when I program a series of tones in a loop and play through LCD with serout, the tones continue to play even after I run a different program (with or without music). I have tried using control codes to turn LCD off and on, disconnecting power and adding long pauses at beginning of program. If the new program has sound, both sounds play simultaneously when I run it. Does anyone know how to correct this?
Comments
The only non-volatile storage available is for custom characters.
I think that it can only 'play notes' if doing so is in the sequence of events.
Alarm: ' alarm sound
x VAR Nib
i VAR Nib
SEROUT 12, 84, [22] ' turn on LCD
SEROUT 12, 84, [208, 219,232] ' note length, octave, pause
FOR x = 1 TO 10 ' repeat pattern 10x
FOR i = 1 TO 8 STEP 2
SEROUT 12, 84, [ (222 + i)] ' note + counter ascending
NEXT
FOR i = 7 TO 0 STEP 2
SEROUT 12, 84, [(222 + i)] ' note + counter descending
NEXT
NEXT