How to display dot on 7-seg , 4 digit


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    May 2005
    Posts
    70

    Angry How to display dot on 7-seg , 4 digit

    we try to used 7-seg 4 digit.
    but we don't know how to display dot (Ex. 45.46)

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Think of the display as a 8 segment display, where the eighth 'segment' is the decimal. Keep this 'segment' off in all the digits, except for the one where you want the decimal to show.

    Regards,

    Anand

  3. #3
    Join Date
    May 2005
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    Need more informatiom
    here is may code :for display 7-seg

    For i = 0 To 3 ' Loop through 4 digits
    n = Value Dig i ' Get digit to display
    Gosub display1 ' Display the value
    NEXT I
    goto mainloop

    display1:
    Digits = $ff ' All digits off to prevent ghosting

    ' Convert binary number in n to segments for LED
    ' COM ANODE 1234567890

    Lookup n, [$3F,$06, $5B, $4F, $66, $6D, $7D, $07, $7F, $6F], Segments

    ' Set digit pin i to 0 (on) and the rest of the pins to 1 (off)

    Digits = ~Dcd i

    Return

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Question

    Your code is not complete! You have a nice lookup table but you do not use the outcome from the table? Where do you use the variable Segments? Is Digits the name of your port? (which you imply when you set it = $FF at one point)

    Also, the way you have it (Digits =~DCD i)
    Digits can only be

    11111110
    11111101
    11111011
    11110111

    Although it is late here, your code makes no sense to me

    However, if Digits does control the port, it looks like you can turn your DP on by issuing this
    Digits.7 = 0
    (provided the wire or trace from the DP goes to pin 7 of your port).

    Post complete code for better shot at guessing what you are trying to do.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    ok it's not 4am (it's 8:15am)

    i see what the dcd command is doing (common anode as you noted).

    For the digit you want to have the dp on try

    Sements.7 = 0 (provided your PORT.7 pin is tied to the DP via wire or trace


    Good Luck
    Last edited by paul borgmeier; - 23rd December 2006 at 15:19.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  6. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    One more time - after a proper days rest, I have no clue what your code does; it looks to me to be partly written for common anode displays ($3F=1) and partly written for common cathode displays (Digits = ~DCD i). The Segments.7=0 should work (right after your lookup table) for the digit you want the DP to be on. Please post full code or schematic for more definite help.
    Again, Good Luck
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. Hdsp 21xx display
    By Original in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th June 2012, 20:07
  2. LED Machine Tach For Tired Eyes
    By Archangel in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 27th January 2010, 14:55
  3. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  4. DS1820 display with 7-seg 4 digits
    By chai98a in forum Code Examples
    Replies: 12
    Last Post: - 10th April 2008, 13:12
  5. 7 segment digit problem (using Mister E's code)
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2005, 20:25

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