I purchased an SP03 and with a little modification to the sample code I was able to make it speak. The booklet that comes with it isn’t real helpful. I wanted to see if I could make it more useful. I connected VL to AX1 and was trying to get the SP03 to read out the voltage. Sounds simple enough. Doesn’t work like I thought it would.
So, my question is: What is the proper syntax to have the SP03 read the value of a variable?
Thanks,
Duane
SDA Con P6 ' Define Data pin
SCL Con P7 ' Define Clk pin
SP03 Con 0xC4 ' SP03 I2C Address
CmdReg Con 0 ' SP03 Command register
LDBUF Con 0x00 ' NOP command is Load buffer
SPKBUF Con 0x40 ' Speak buffer Command
Volts Var word ' VL a/d reading
Main
adin 1,Volts
i2cout SDA, SCL, SP03, CmdReg, [LDBUF, 0, 5, 3, "Logic voltage is ",Volts," volts.", 0]
i2cout SDA, SCL, SP03, CmdReg, [SPKBUF]
GoSub Wait4Shutup
Forever: goto Forever
End
Wait4Shutup:
i2cin SDA, SCL, SP03, CmdReg, [Stat]
if (stat-128)>0 then wait4shutup
return
Um, wouldn’t the Acroname forum be a more logical place to ask questions about how their product is supposed to work? They even have a search thing in the upper right corner of the page that returns lots of hits if you enter SP03.
I agree with Eddie, that you might get some better input from the Acroname forum as they are probably more familiar with the module.
I Could not tell from your question if you want your software to be able to retrieve the value of some variable on the SP03 or do you want the SP03 to output audibly the value of some variable in your software?
In your example code you posted did it output the actual voltage? Or did it only output the string “Logic voltage…”. If this is the problem you might try something like:
i2cout SDA, SCL, SP03, CmdReg, [LDBUF, 0, 5, 3, "Logic voltage is ",Volts," dec volts.", 0]
I came over here from the Basic Micro Forum because it was suggested that I might get better results. What I want is the want the SP03 to output audibly the value of some variable in your software. I know there are some enthusiasts who use the SP03 (speech synthesizer) and thought thaey might have some advice to offer.
As per the suggestions, I’ve posted my question to the Acroname forum too.
If the help requested is dealing specifically with the Atom code, then yes we are a good source for information. But if the problem area is interpreting how the SP03 works then Acroname is your best bet. We will try to help regardless. Did Kurte’s reply help at all?
Heh, BasicMicro sent you here because a lot of the users here use their products since they are used/sold with many of the kits Lynxmotion sells.
Nothing in your code sample smacks of syntax or other coding error (other than I don’t see where you declared the variable Stat, presumably a byte) which is why I was thinking it might have more to do with the details of using the SP03 product than the fact you used a BAP vs. brainstem controller.