Está en la página 1de 2

Device 16F877A

Xtal 20
All_Digital true
Declare Keypad_Port PORTB
PortB_Pullups=1
TRISC=$00
Declare LCD_DTPin PORTC.4 'pin de datospin menos significativo
Declare LCD_RSPin PORTC.2
Declare LCD_RWPin PORTC.1 'lectura
Declare LCD_ENPin PORTC.0 'habibilitador
Dim v[5] As Byte'[numero de vectores que tiene 5]
Dim i As Byte' incrementar el vector
Dim tecla As Byte
Dim t As Byte
inicio:

'$fe sigifica que el lcd "te voy a enviar un comando" y 132 128+4 """"128 es la
direccion base que apunta al bloque de memoria DDram.... si coloco 128 aparece e
n la posicion 1 .. +4 es para q empiece en la posicion 4
Print $fe,132, "DEC a HEX"
DelayMS 50 'minimo de 200
Print At 1,4,$22 'at indicar coordenadas
Print At 1,14,$22 ' para q aparezca en la posicion 13
DelayMS 50
Print $fe, $40,$10,$18,$1c,$1e,$1e,$1c,$18,$10'$40 direccion base de la cgram, 6
4 en $40 .... en otro print sele suma 8 en decimal luego en hexadecimal $48 -$50

Print $fe, $48,$01,$03,$07,$0f,$07,$03,$01
Print At 1,1,$00 'primera posicion en la memoria cgram primero se crea y despu
es se llama
Print At 1,16,$01
DelayMS 50
Print At 2,1,"DEC=xxx HEX=xx"
DelayMS 50
For i=0 To 2

GoSub teclado
t=tecla
v[i]=t

Print At 2,i+5, Dec t

DelayMS 50

Next

v[3]=v[0]*100+v[1]*10+v[2]*1

Print At 2,13,Hex v[3]

DelayMS 500

GoSub teclado

GoTo inicio
teclado:
tecla=16
While tecla=16
tecla=LookUp InKey,[1,2,3,255,4,5,6,255,7,8,9,255,"*",0,"#",255]
Wend
DelayMS 500

Return

También podría gustarte