
Originally Posted by
CumQuaT
Has anyone had a play around with this before?
I did ! (-Played-) several yrs ago....
look at this i dont remember but it's part off a bigger program... any way I hope you can find it useful...
Code:
'ps2 emu-sw betomax
DEFINE SHIFT_PAUSEUS 15
char var Word 'character
datpin var porta.0 'Keyboard Data ' 10k pull up
clkpin var porta.1 'Keyboard Clock ' 10k pull up
col VAR BYTE ' Keypad column
row VAR BYTE ' Keypad row
key VAR BYTE ' Key value
delayer con 100 'delay btw chars
CMCON = 7
trisa =0
datpin = 1
clkpin = 1
OPTION_REG.7 = 0 ' Enable PORTB pull-ups
h var word : h = %11001100110
o var word : o = %11010001000
l var word : l = %11010010110
a var word : a = %10000111000
b var word : b = %10001100100
c var word : c = %11001000010
d var word : d = %10001000110
uno var word : uno = %10000101100
dos var word : dos = %11000111100
tres var word : tres = %10001001100
cuatro var word : cuatro = %10001001010
extcode var word : extcode = %10111000000 'e0
berak var word : berak =%11111100000 'f0
intro var word : intro = %11010110100 '5a
Start:
GOSUB Getkey ' from switch / keypad
Select CASE Key ' wich key ??
case 1
char = uno : GOSUB sendchar : pause 500
case 2
char = dos :GOSUB sendchar : pause 500
case 3
char = tres :GOSUB sendchar: pause 500
case 4
char = cuatro: GOSUB sendchar: pause 500
case 5
char = a : GOSUB sendchar: pause 500
case 6
char = b: GOSUB sendchar: pause 500
case 7
char = c : GOSUB sendchar: pause 500
case 8
char = d : GOSUB sendchar: pause 500
case 9
char =h:GOSUB sendchar: pause 500
case 10
char =o:GOSUB sendchar: pause 500
case 11
char = l:GOSUB sendchar: pause 500
END SELECT
pause 500
goto start
'actually make ps2 tx !
sendchar:
shiftout datpin,clkpin,0,[char\11] : pauseus 50
shiftout datpin,clkpin,0,[berak\11] : pauseus 50
shiftout datpin,clkpin,0,[char\11]: pauseus 50
return
Bookmarks