Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Customize 7 segment display

Status
Not open for further replies.

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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top