stuartX
02-11-2012, 04:26 PM
Hi all,
I know this subject has been hashed out in the past. But, I check the post and did not see this specific request. I connected and used the example code for the Emic board and it works fine.
What I'm trying to do is adjust the volume and that's not working (its my code). I tried different examples and still can't get the volume to change. I also tried reset as well.
Can someone tell me what I'm doing wrong please? The code is below.
THIS CODE WORKS:
Tx PIN 0 ' connects to Emic SIn
Rx PIN 1 ' connects to Emic SOut
Busy PIN 2 ' 1 = busy
' -----[ Constants ]-------------------------------------------------------
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
Baud CON 396 ' 2400 baud, N81
#CASE BS2SX, BS2P
Baud CON 1021
#ENDSELECT
Yes CON 1
No CON 0
' Emic Commands (Hex Mode)
Say CON $00 ' say Engish text
Volume CON $02 ' set volume, 0 - 7
Speed CON $04 ' set speed, 0 - 4
Pitch CON $03 ' set pitch, 0 - 6
AddAbbr CON $04 ' add abbreviation
DelAbbr CON $05 ' delete abbreviation
ListAbbr CON $06 ' list abbreviations
Version CON $07 ' get version
Reset CON $08 ' soft reset
Audio CON $09 ' enable audio in
PhT CON $10 ' start of phonetic text
Help CON $FE ' display help
EOM CON $AA ' end of message
OK CON $55 ' "okay" for hex mode
' -----[ Program Code ]----------------------------------------------------
vol VAR Byte
response VAR Nib
Main:
GOSUB Check_Busy
SEROUT Tx, Baud, [Say, "Testing 1 2 3.", EOM]
PAUSE 100
Check_Busy:
PAUSE 1 ' allow busy to activate
' DO WHILE (Busy = Yes) : LOOP ' wait until not busy
RETURN
Set_Volume:
vol = 2
SEROUT TX, Baud, [Volume, DEC1 vol, EOM] ' send to Emic
GOTO Main
END
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++
When I replace Main with the following to adjust volume, it does not work:
Main:
GOSUB Set_Volume
GOSUB Check_Busy
SEROUT Tx, Baud, [Say, "Testing 1 2 3.", EOM]
PAUSE 100
Help is appreciated.
Thanks (in advance)
I know this subject has been hashed out in the past. But, I check the post and did not see this specific request. I connected and used the example code for the Emic board and it works fine.
What I'm trying to do is adjust the volume and that's not working (its my code). I tried different examples and still can't get the volume to change. I also tried reset as well.
Can someone tell me what I'm doing wrong please? The code is below.
THIS CODE WORKS:
Tx PIN 0 ' connects to Emic SIn
Rx PIN 1 ' connects to Emic SOut
Busy PIN 2 ' 1 = busy
' -----[ Constants ]-------------------------------------------------------
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
Baud CON 396 ' 2400 baud, N81
#CASE BS2SX, BS2P
Baud CON 1021
#ENDSELECT
Yes CON 1
No CON 0
' Emic Commands (Hex Mode)
Say CON $00 ' say Engish text
Volume CON $02 ' set volume, 0 - 7
Speed CON $04 ' set speed, 0 - 4
Pitch CON $03 ' set pitch, 0 - 6
AddAbbr CON $04 ' add abbreviation
DelAbbr CON $05 ' delete abbreviation
ListAbbr CON $06 ' list abbreviations
Version CON $07 ' get version
Reset CON $08 ' soft reset
Audio CON $09 ' enable audio in
PhT CON $10 ' start of phonetic text
Help CON $FE ' display help
EOM CON $AA ' end of message
OK CON $55 ' "okay" for hex mode
' -----[ Program Code ]----------------------------------------------------
vol VAR Byte
response VAR Nib
Main:
GOSUB Check_Busy
SEROUT Tx, Baud, [Say, "Testing 1 2 3.", EOM]
PAUSE 100
Check_Busy:
PAUSE 1 ' allow busy to activate
' DO WHILE (Busy = Yes) : LOOP ' wait until not busy
RETURN
Set_Volume:
vol = 2
SEROUT TX, Baud, [Volume, DEC1 vol, EOM] ' send to Emic
GOTO Main
END
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++
When I replace Main with the following to adjust volume, it does not work:
Main:
GOSUB Set_Volume
GOSUB Check_Busy
SEROUT Tx, Baud, [Say, "Testing 1 2 3.", EOM]
PAUSE 100
Help is appreciated.
Thanks (in advance)