axslave.tmb for the DR51 Slave keypad and relay for host computer. If switch is pressed on keypad send its assigned character. Turn relays on and off with single received characters. ------------------------------- NEW --- see if character received from host computer 1 A=KEY 2 IF A=0 20 exit if ESCape is received 3 B=27 4 IF A=B 0 number 1 is Relay 1 on 5 B="1" 6 IF A<>B 9 7 RELAY1=1 8 GOTO 20 number 2 is Relay 2 on 9 B="2" 10 IF A<>B 13 11 RELAY2=1 12 GOTO 20 number 3 is Relay 1 off 13 B="3" 14 IF A<>B 17 15 RELAY1=0 16 GOTO 20 number 4 is Relay 2 off 17 B="4" 18 IF A<>B 20 19 RELAY2=0 see if switch on keypad pressed 20 READKP 21 IF A=0 1 flash LED for feedback 22 LED=1 delay for switch debounce 23 DELAY 1 wait for user to remove finger from button 24 READKP 25 IF A<>0 24 26 LED=0 send key to host computer 27 A=B 28 PRINT (A) delay for switch debounce 29 DELAY 1 30 GOTO 1 --- assign I/O signals to keypad rows and columns 230 PRINT 8 231 PRINT 7 232 PRINT 6 233 PRINT 5 234 PRINT 4 235 PRINT 3 236 PRINT 2 237 PRINT 1 --- assign values to 4 by 4 keypad 240 PRINT "1" 241 PRINT "2" 242 PRINT "3" 243 PRINT "A" 244 PRINT "4" 245 PRINT "5" 246 PRINT "6" 247 PRINT "B" 248 PRINT "7" 249 PRINT "8" 250 PRINT "9" 251 PRINT "C" 252 PRINT "*" 253 PRINT "0" 254 PRINT "#" 255 PRINT "."