Simple but it works :)
First this is not a pulse counter.This is only the way that i found by my self.
Coz there re no command for 7 segment (i hope they will do)
and u can use like a pulse counter by useing little subrutines
all PORTB connedted to the 7 segment
PORTA.1 enable diggit 1
PORTA.2 enable diggit 2
i did it without transistor if u want to see better
u can put a transistor and decrase the pause command
'''''''''''''''''''''''''''''''''The codes
sayac VAR BYTE
dij1 VAR BIT[9]
dij2 VAR BIT[9]
sayac=0
gosterge1:
IF sayac > 99 Then sayac =0
dij1 = sayac DIG 0
High PORTA.1
IF dij1=0 Then TRISB=%00111111
IF dij1=1 Then TRISB=%00000110
IF dij1=2 Then TRISB=%01011011
IF dij1=3 Then TRISB=%01001111
IF dij1=4 Then TRISB=%01100110
IF dij1=5 Then TRISB=%01101101
IF dij1=6 Then TRISB=%01111101
IF dij1=7 Then TRISB=%00000111
IF dij1=8 Then TRISB=%01111111
IF dij1=9 Then TRISB=%01100111
Pause 90
Low PORTA.1
dij2 = sayac DIG 1
High PORTA.2
IF dij2=0 Then TRISB=%00111111
IF dij2=1 Then TRISB=%00000110
IF dij2=2 Then TRISB=%01011011
IF dij2=3 Then TRISB=%01001111
IF dij2=4 Then TRISB=%01100110
IF dij2=5 Then TRISB=%01101101
IF dij2=6 Then TRISB=%01111101
IF dij2=7 Then TRISB=%00000111
IF dij2=8 Then TRISB=%01111111
IF dij2=9 Then TRISB=%01100111
Pause 90
Low PORTA.2
sayac = sayac + 1
Pause 300
GoTo gosterge1
End
I know it's really simple but i am a newbie i can't do better now
Last edited by SuB-ZeRo; - 17th June 2005 at 06:16.
Asking is not a shame but not learning is a SHAME!!!
Bookmarks