You are on page 1of 2

Device = 16F877

ALL_DIGITAL = true
XTAL = 20
trisc = $00
declare keypad_port portb
portb_pullups = true
declare lcd_rspin portc.0
declare lcd_rwpin portc.1
declare lcd_enpin portc.2
declare lcd_dtpin portc.4
portc.1 = 0
portc.2 = 1
dim tecla as byte
dim Valor[2] as byte
dim Es[8] as word
dim X as byte
dim Y as byte
inicio:
print at 1,1," Bienvenido al"
print at 2,1," Sistema para"
delayms 1000
print at 1,1,"Generar por paso"
delayms 1000
print at 2,1,"Caracteres Esp."
delayms 1000
cls
for X = 0 to 7
es[x] = 0
next X
for Y = 0 to 7
for X = 0 to 1
gosub teclado
Valor[X] = tecla
print at 1,X+1, dec Valor[x]
next X
Es[Y] = Valor[0]*10 + Valor[1]
delayms 1000
cls
print $FE, 64,Es[0],Es[1],Es[2],Es[3],Es[4],Es[5],Es[6],Es[7]
print at 1,4,0," ",0," ",0
next Y
print at 2,1,"* para Retornar"
gosub Retornar
goto inicio
Retornar:
tecla = 255
while tecla <> "*"
tecla = lookup inkey, [1,2,3,255,4,5,6,255,7,8,9,255,"*",0,"#",255]
delayms 150
wend
return
teclado:
tecla = 255
while tecla = 255
tecla = lookup inkey, [1,2,3,255,4,5,6,255,7,8,9,255,"*",0,"#",255]
delayms 200
wend
return

You might also like