hola colegas electronicos, tengo un problema con un proyecto necesito saber o como hacer para poner un contador en el siguiente programa que me me mande un mensaje cuando ya haya contado 4 vcs no se si me explico bien bueno acontinuacion el proyecto y gracias
program cerradura_electronica
dim clave, kp, tp, ca, cc, j, i as byte
dim keypadport as byte at portd 'conexion del teclado en portd
keypadport_direction as byte at trisd
dim lcd_rs as sbit at rb0_bit
lcd_en as sbit at rb1_bit
lcd_d7 as sbit at rb7_bit
lcd_d6 as sbit at rb6_bit
lcd_d5 as sbit at rb5_bit
lcd_d4 as sbit at rb4_bit
lcd_rs_direction as sbit at trisb0_bit
lcd_en_direction as sbit at trisb1_bit
lcd_d7_direction as sbit at trisb7_bit
lcd_d6_direction as sbit at trisb6_bit
lcd_d5_direction as sbit at trisb5_bit
lcd_d4_direction as sbit at trisb4_bit
dim int_clave as string[20]
sub procedure config_pic
keypad_init()
adcon1=7 'I/O digital
porta=0
trisa=0
portb=0
trisb=0
portc=0
trisc=0
portd=0
trisd=0
lcd_init()
lcd_cmd(_lcd_cursor_off)
lcd_cmd(_lcd_clear)
end sub
sub procedure guardar_clave
for i=0 to 4
eeprom_write(i,clave)
delay_ms(25)
next i
end sub
sub procedure leer_teclado()
lcd_cmd(_lcd_second_row)
for j=1 to tp
lcd_chr_cp("*")
next j
kp=254
while kp=254
kp=keypad_key_press
wend
end sub
main:
config_pic
portc.4=1
int_clave="INTRODUZCA SU CLAVE:"
lcd_out(1,1,int_clave)
while true
kp=0
while(kp=0)
kp=keypad_key_click()
wend
lcd_out_cp("*")
' if kp=4 then
' portc.7=1
' end if
wend
end.