symbol spk = b.5
symbol lcd = b.7
symbol key = w6
symbol junk = b8
init:
pause 500
serout Lcd,N2400,(254,128,"project picaxe ")
serout Lcd,N2400,(254,192," keypad 40x2 ")
pause 1000
serout Lcd,N2400,(254,128," hit my keys ")
pause 1000
serout lcd,n2400, (254,1)
do
wait_for_keypress:
readadc 0,junk
if junk < 4 then wait_for_keypress
pause 25
readadc 0, key
wait_for_release:
readadc 0 , junk
if junk > 5 then wait_for_release
bintoascii key, b4, b3, b2, b1, b0
serout lcd,n2400, (254,192, "key value", b2, b1, b0," ")
pause 10
if key = 193 then gosub one
if key = 162 then gosub two
if key = 121 then gosub three
if key = 208 then gosub four
if key = 173 then gosub five
if key = 127 then gosub six
if key = 177 then gosub seven
if key = 151 then gosub eight
if key = 115 then gosub nine
if key = 203 then gosub star
if key = 125 then gosub Hash
if key = 169 then gosub naught
loop
one: sound spk, (10,50)
pause 10
serout lcd,n2400, (254,128, " botton 0ne ")
pause 1000
return
two: sound spk, (20,50)
pause 10
serout lcd,n2400, (254,128, " botton two ")
pause 1000
return
three:sound spk, (30,50)
pause 10
serout lcd,n2400, (254,128, " botton three ")
pause 1000
return
four: sound spk, (40,50)
pause 10
serout lcd,n2400, (254,128, " botton four ")
pause 1000
return
five: sound spk, (50,50)
pause 10
serout lcd,n2400, (254,128, " botton five ")
pause 1000
return
six:sound spk, (60,50)
pause 10
serout lcd,n2400, (254,128, " botton six ")
pause 1000
return
seven:sound spk, (70,50)
pause 10
serout lcd,n2400, (254,128, " botton seven ")
pause 1000
return
eight:sound spk, (100,30)
pause 10
serout lcd,n2400, (254,128, " botton eight ")
pause 1000
return
nine:
sound spk, (100,20)
pause 10
serout lcd,n2400, (254,128, " botton nine ")
pause 1000
return
star:
sound spk, (100,320)
pause 10
serout lcd,n2400, (254,128, " botton * ")
pause 1000
return
hash:
sound spk, (100,320)
pause 10
serout lcd,n2400, (254,128, " botton # ")
pause 1000
return
naught:
sound spk, (100,320)
pause 10
serout lcd,n2400, (254,128, " botton 0 ")
pause 1000
return