'June 19, 1999 Button one did not work very well. Trying alternate method. 'This method works great! PBP 2.2 392 words DEFINE OSC 10 OPTION_REG.7 = 0 trisb = %11110000 rx1 var portb.0 rx2 var portb.1 rx3 var portb.2 rx4 var portb.3 cy1 var portb.4 cy2 var portb.5 cy3 var portb.6 key var byte key = 0 loop: rx1 = 0 pause 10 gosub getkeya rx1 = 1 rx2 = 0 pause 10 gosub getkeyb rx2 = 1 rx3 = 0 pause 10 gosub getkeyc rx3 = 1 rx4 = 0 pause 10 gosub getkeyd rx4 = 1 goto loop getkeya: if cy1 = 0 then key = 1 gosub tones gosub waita endif if cy2 = 0 then key = 2 gosub tones gosub waitb endif if cy3 = 0 then key = 3 gosub tones gosub waitc endif return getkeyb: if cy1 = 0 then key = 4 gosub tones gosub waita endif if cy2 = 0 then key = 5 gosub tones gosub waitb endif if cy3 = 0 then key = 6 gosub tones gosub waitc endif return getkeyc: if cy1 = 0 then key = 7 gosub tones gosub waita endif if cy2 = 0 then key = 8 gosub tones gosub waitb endif if cy3 = 0 then key = 9 gosub tones gosub waitc endif return getkeyd: if cy1 = 0 then key = 10 gosub tones gosub waita endif if cy2 = 0 then key = 0 gosub tones gosub waitb endif if cy3 = 0 then key = 11 gosub tones gosub waitc endif return waita: while cy1 = 0 wend return waitb: while cy2 = 0 wend return waitc: while cy3 = 0 wend return tones: dtmfout porta.3, [#key] return