# Thread: Simulating a seven segment display

1. ## Simulating a seven segment display

Can someone help ? This is regarding my project that has to be given in in 2 days time,so I would really appreciate if someone would help me on this.

The project is on a petrol pump,they ask us to simulate a seven segment display to produce the numers,i.e:
_
|_|
|_|

In that form.So I need a code that,when you enter a number it would be displayed on a diffrernt window containing the 7 segment display.Its a colour change,i.e, default color of label is gray,when you enter the number 1,only the lines on the left would change to a colour like orange,etc.

3. ## Re: Simulating a seven segment display

May I see the whole thread of this ?

4. ## Re: Simulating a seven segment display

There's a link just above the post to view the whole thread...

5. ## Re: Simulating a seven segment display

vb Code:
```'a led setup
Type t7Segment
Led(7) As Boolean
End Type
'stores the led setup for each number
Dim LedNumber(10) as t7Segment
'makes the specified led setup
Function New7Segment(S0 As Boolean,
S1 As Boolean,
S2 As Boolean,
S3 As Boolean,
S4 As Boolean,
S5 As Boolean,
S6 As Boolean,
S7 As Boolean) As t7Segment
New7Segment(0) = S0 'dot
New7Segment(1) = S1 'top
New7Segment(2) = S2 'top right
New7Segment(3) = S3 'bottom right
New7Segment(4) = S4 'bottom
New7Segment(5) = S5 'bottom left
New7Segment(6) = S6 'top left
New7Segment(7) = S7 'center
End FUnction
'generates the led setup for each number
Function GetLedNumber(Number As Long) As t7Segment
Select Case Number
Case 0
GetLedNumber = New7Segment(0, 1, 1, 1, 1, 1, 1, 0)
Case 1
'etc
Case Else
GetLedNumber = New7Segment(0, 0, 0, 0, 0, 0, 0, 0)
End Select
ENd Function
'builds the saved led setup for each number
Sub Initialize()
LedNumber(0) = New7Segment(0, 1, 1, 1, 1, 1, 1, 0)
'etc
End Sub```
You can then write code to draw the leds (draw lines, turn shapes on/off, etc) that accepts a t7Segment as input.

6. ## Re: Simulating a seven segment display

And that thread was closed for posting...

If you click on that link, you will find THIS:
Originally Posted by ictteacheruk129
Please do not help this student on any topics related to this petrol station project.I do not mean to be cruel to them,but this is currently a nationally tested course in college over here in the UK at the moment.And it gives the student an unfair advantage over others if they are getting outside help from more experienced VB programmers,rather than learning how to work around these problems themselves.You're Co-operation will be greatly appreciated and on behalf of the British Higher educational services I thank you

sincerely
Jerry Rolands

#### Posting Permissions

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