Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Device 16F628A
Xtal 4
TRISB=%00000011
TRISA=%00000
All_Digital = true
'*********************
Symbol sensor=PORTB.0
'************************
PORTB=0
PORTA=0
'******************
Dim M As Word
Dim C As Word
Dim D As Word
Dim U As Word
Dim CONT As Word
Dim i As Byte
M=0: C=0 :D=0 : U=0
CONT=0
PRINCIPAL:
For i=0 To 20
PORTA = U
PORTB=16
DelayMS 5
PORTA= D
PORTB=32
DelayMS 5
PORTA = C
PORTB=64
DelayMS 5
PORTA= M
PORTB=128
DelayMS 5
Next i
SEGUIR:
CONT= CONT+1
M=(CONT)/1000
C= (CONT)/100-(10*M)
D= (CONT)/10-(100*M+10*C) 'asigna la parte entera
U= CONT-(1000*M+100*C+10*D) 'asigna la unidad
' If Cont = 0 Then LAMP=1
If CONT = 9999 Then GoTo REINICIAR
BUCLE:
If sensor = 0 Then PRINCIPAL
GoTo BUCLE
'**********************
REINICIAR:
CONT=0
PORTA=0
GoTo PRINCIPAL