CODE: tone.bas

'DTMF test program - cicciocb 2019
' call the sub DTMF with the symbol in string format
'
D0=16:D1=5:D2=4:D3=0:D4=2:D5=14:D6=12:D7=13:D8=15:D9=3:D10=1

dim rows(4) = 697,   770,  852, 941
dim cols(4) = 1209, 1336, 1477, 1633
dim SYMB$(16) = "1", "2", "3", "A", "4", "5", "6", "B", "7", "8", "9", "C", "*", "0", "#", "D"
pin_T1 = D7  'output pin tone 1
pin_T2 = D8  'output pin tone 2

DTMF "0"   'send a tone 

end

sub DTMF(sim$)
  local z
  for z = 0 to 15
    if (SYMB$(z) = ucase$(sim$)) then
      pin.tone pin_T1, cols(z and 3)
      pin.tone pin_T2, rows(z >> 2)
      pause 2500 ' duration of the tone
      pin.tone pin_T1, 0
      pin.tone pin_T2, 0
      exit for
    end if
  next z
end sub
CODE: dtmf.bas

'DTMF test program - cicciocb 2019
' call the sub DTMF with the symbol in string format
' use the new variables HtmlEventButton$ and HtmlEventVar$
D0=16:D1=5:D2=4:D3=0:D4=2:D5=14:D6=12:D7=13:D8=15:D9=3:D10=1

dim rows(4) = 697,   770,  852, 941
dim cols(4) = 1209, 1336, 1477, 1633
dim SYMB$(16) = "1", "2", "3", "A", "4", "5", "6", "B", "7", "8", "9", "C", "*", "0", "#", "D"
pin_T1 = D7  'output tone 1
pin_T2 = D8  'output tone 2

COUNTER.SETUP 1, D5, 1
COUNTER.SETUP 2, D4, 1
timer0 1000, freq


cls
c$ = "abcd"
s = 1
ck = 0
a$ = ""
a$ = a$ + "<table>"
a$ = a$ + "<tr><td>" + button$("1", butpress) + "</td><td>" + button$("2", butpress) + "</td><td>"
a$ = a$ + button$("3", butpress) + "</td><td>" + button$("A", butpress) +"</td></tr>" 
a$ = a$ + "<tr><td>" + button$("4", butpress) + "</td><td>" + button$("5", butpress) + "</td><td>" 
a$ = a$ + button$("6", butpress) + "</td><td>" + button$("B", butpress) +"</td></tr>" 
a$ = a$ + "<tr><td>" + button$("7", butpress) + "</td><td>" + button$("8", butpress) + "</td><td>" 
a$ = a$ + button$("9", butpress) + "</td><td>" + button$("C", butpress) +"</td></tr>" 
a$ = a$ + "<tr><td>" + button$("*", butpress) + "</td><td>" + button$("0", butpress) + "</td><td>"
a$ = a$ + button$("#", butpress) + "</td><td>" + button$("D", butpress) +"</td></tr>"
a$ = a$ + "</table>" 
html a$
onhtmlchange changeme
DTMF "0"

wait

freq:
print counter.freq(1), counter.freq(2)
return

butpress:
print "butpress", HtmlEventButton$
DTMF HtmlEventButton$
return

changeme:
print "changeme", HtmlEventVar$
return

sub DTMF(sim$)
  local z
  for z = 0 to 15
    if (SYMB$(z) = ucase$(sim$)) then
      pin.tone pin_T1, cols(z and 3)
      pin.tone pin_T2, rows(z >> 2)
      pause 2500 ' duration of the tone
      pin.tone pin_T1, 0
      pin.tone pin_T2, 0
      exit for
    end if
  next z
end sub

Code: popoo.bas