7 segment digit problem (using Mister E's code)


Results 1 to 8 of 8

Threaded View

  1. #3
    Join Date
    May 2005
    Posts
    49


    Did you find this post helpful? Yes | No

    Smile 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!!!

Similar Threads

  1. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  2. pic18F code size problem???
    By dogi in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th March 2005, 22:52
  3. WRITE not working
    By servo260 in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 29th December 2004, 03:02
  4. Driver code for 14 segment LED display
    By Durward Searcy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th December 2004, 21:08
  5. Multiplex two 7 segment display
    By Fernando Santos in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th July 2003, 14:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts