Customize 7 segment display

The Ponderer

New Member
Hello all
I was wondering how to arrange coding so that only the digits 0,1,2,3 and 4 would be illuminated on a 7 segment display.
Digits 5,6,7,8 and 9 to be rejected (blank display).
Or have I missed something really obvious?
Thanks
 
Using the 'Select Case' command would be a good way to go if it's available. In pseudo code:

Code:
7seg = SomeVariable/10
PortB = Num
7seg = SomeVariable - 7seg*10
PortC = Num

Select Case 7seg
    Case 1
    Num = b'xxxxxxxx'  ;Numeral 1 segments to turn on?
    Case 2
    NUM = b'xxxxxxxx'  ;Numeral 2 segments to turn on?
    ...
    ...
    Case 5
    NUM = b'00000000'  ;Numeral 5 segments all off
    Case 6
    NUM = b'00000000'  ;Numeral 6 segments all off
    ....
    ....
end Select
 
i have one doubt.,am using pic 18F4431 for pwm generation.,i would like to display my dutycycle using 7 segment LED.,wt can i do to display dutycyle.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…