DISPLAY 7 SEG
Ejemplo 1
Device 16F628A
Xtal 4
TRISB=%11110000
Dim numero As Byte
Symbol bot PORTB.4
iniciar:
numero = 0
display:
PORTB=numero
If bot=0 Then aumentar
GoTo display
aumentar:
If bot=0 Then aumentar
DelayMS 200
If numero=9 Then iniciar
numero=numero + 1
GoTo display
End
Ejemplo 2
Device 16F877
Xtal = 4
Dim Number As Byte
All_Digital = True
PortB_Pullups = False
TRISB = 000000
Main:
Number = 0
Repeat
GoSub Encode_Segment_Display
DelayMS 500
Inc Number
Until Number = 10
GoTo Main
Encode_Segment_Display:
Select Number
Case 0
PORTB = 111111
Case 1
PORTB = 000110
Case 2
PORTB = %01011011
Case 3
PORTB = %01001111
Case 4
PORTB = %01100110
Case 5
PORTB = %01101101
Case 6
PORTB = %01111100
Case 7
PORTB = 000111
Case 8
PORTB = %01111111
Case 9
PORTB = %01100111
EndSelect
Return
Suscribirse a:
Entradas (Atom)
se puede aser con pulsador
ResponderBorrar