'========================================================== ' ' PicStic4 PicBASIC Pro Demo for displaying Keypresses on a ' 4x20 LCD using the PASS call ' Written in PicBasic Pro ' Version 2.30 ' '========================================================== ' Include "modedefs.bas" ' includes serial modes B19 var byte 'COMMAND (FOR PASS) B20 var byte 'LSB OF PARAMETER (FOR PASS) B21 var byte 'MSB OF PARAMETER (FOR PASS) START: B19=3 : B20=0 : B21=32 'SET THE CONFIGURATION WORD call PASS if B19=3 and B20=255 and B21=255 then LOOP gosub ERR : pause 50: goto START LOOP: B19=28 : B20=0 : B21=0 'GET KEYPAD PRESS call PASS if B19=28 and B21=0 then LOOP1 gosub ERR : goto LOOP LOOP1: if B20<>255 then LCD goto LOOP LCD: B21=B20//10 + 48 : B20=B20/10 + 48 'KEYPAD VALUE INTO 2 DECIMAL DIGITS B19=27 'PRINT TO LCD call PASS if B19=27 and B20=255 and B21=255 then LCD1 gosub ERR : goto LCD LCD1: B19=27 : B20=32 : B21=0 ' PRINT TO LCD (a space) call PASS if B19=27 and B20=255 and B21=255 then LCD2 gosub ERR : goto LCD1 LCD2: goto LOOP ERR: serout 7,N9600,["Comm Error-",#B19,13,10] : RETURN