#picaxe 20m2
#no_data
setfreq m16 ' 16 Mhz servo commands only work at 4 and 16 mhz
' 8 or 16 MHz required for 9600 baud serial data
dirsb=%11010111
outpinsb=3 ' initialize center LED on
input b.5 'speaking line from 512
output b.4 'send 9600 baud true 8N1 data to sp0-512
GOSUB waitspeak
high 4:pause 10' manual 2 p.209 says set pin high before sending true data
SEROUT 4,T9600_16,(13,13) 'initialize
qq:
touch16 [%11101000],c.1,w1':sertxd("w1=",#w1,13,10)
touch16 [%11101000],c.2,w2':sertxd("w2=",#w2,13,10)
touch16 [%11101000],c.3,w3':sertxd("w3=",#w3,13,10)
if w1>1200 then
'sertxd("one",13,10)
SEROUT 4,T9600_16,("[V6] [S3] [E3]1",13,13)
GOSUB waitspeak
endif
if w2>1200 then
'sertxd("two",13,10)
SEROUT 4,T9600_16,("[V6] [S3] [D3]2",13,13)
GOSUB waitspeak
endif
if w3>1200 then
'sertxd("three",13,10)
SEROUT 4,T9600_16,("[V6] [S3] [C3]3",13,13)
GOSUB waitspeak
endif
goto qq
waitspeak:
PAUSE 50
test:IF pinb.5=1 THEN test
PAUSE 50
RETURN