Now I need help programming my WTV020-SD-16P Voice Module. I used the flowchart programming
method to write my program; however, there are no flowcharts to code a voice module.
I have 8 messages to play that are 'located' in 4 separate flowchart procedures. Some messages only play
once and stop. Some replay based on inputs that I have to test after a message is played. Some will play
until the power is turned off.
I think I may be able to use the following BASIC code to allow single or multiple plays by entering
the code at each location in a BASIC flowchart box. I think I used 'put' and 'get' correctly to pass and
receive variables. I know the PLAYER PROCEDURE needs work and I hope someone can help me with it. In a
previous post on page 2 of this thread, Hippy provided general code for control of a voice module for which
I am grateful; however, I am unable to figure out how to change it to make it do what I need. I hope he or
somebody can help.
Additionally, my project does not have an end. The program ends when the breadboard power is turned off from a
manual switch. The power may be turned off at any time during any function being executed. Does the program
automatically reset to the start position when power is turned on or do I need something to enable the program to
reset when power is turned back on? I want to start the program at the beginning and not just continue executing
at the place it was when the power was previously turned off. If something is needed, what do I do?
Code:
BASIC BOX IN FLOWCHART PROGRAM
b1 = 1 ; play flag in put/get 1
b2 = (I enter volume number) ; message volume from 1-7 in put/get 2
b3 = 1 ; stop flag in put/get 3
w1 = (I enter message name) ; message number (0000-0007) plus '.ad4' in put/get 4
Voice:
put 1, b1
put 2, b2
put 4, word w1
gosub Player
get 3, b3
if b3 = 1 then
(Based on 'location', I will enter a test that will yield b1 = 1 or b1 = 0)
goto Voice
endif
(My 14M2 output pins for the Voice Module are: RST = B.5, CLK = B.4, DAT = B.3)
PLAYER PROCEDURE
get 1, b1
get 2, b2
get 4, word w1
if b1 = 1 then
volume = b2
Pause 2000
play w1
b3 = 1
put 3, b3
return
else
stop
reset Voice Module
endif
b3 = 0
put 3, b3
return