PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Simulating a seven segment display-VBForums
Results 1 to 6 of 6

Thread: Simulating a seven segment display

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    2

    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.

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Simulating a seven segment display

    Last edited by anhn; May 6th, 2008 at 01:31 AM.
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    Baby Steps a guided tour
    IsDigits() and IsNumber() functions Wichmann-Hill Random() function >> and << functions for VB CopyFileByChunk

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    2

    Re: Simulating a seven segment display

    May I see the whole thread of this ?

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Simulating a seven segment display

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

  5. #5
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: Simulating a seven segment display

    vb Code:
    1. 'a led setup
    2. Type t7Segment
    3.     Led(7) As Boolean
    4. End Type
    5.  
    6. 'stores the led setup for each number
    7. Dim LedNumber(10) as t7Segment
    8.  
    9. 'makes the specified led setup
    10. Function New7Segment(S0 As Boolean,
    11.                      S1 As Boolean,
    12.                      S2 As Boolean,
    13.                      S3 As Boolean,
    14.                      S4 As Boolean,
    15.                      S5 As Boolean,
    16.                      S6 As Boolean,
    17.                      S7 As Boolean) As t7Segment
    18.     New7Segment(0) = S0 'dot
    19.     New7Segment(1) = S1 'top
    20.     New7Segment(2) = S2 'top right
    21.     New7Segment(3) = S3 'bottom right
    22.     New7Segment(4) = S4 'bottom
    23.     New7Segment(5) = S5 'bottom left
    24.     New7Segment(6) = S6 'top left
    25.     New7Segment(7) = S7 'center
    26. End FUnction
    27.  
    28. 'generates the led setup for each number
    29. Function GetLedNumber(Number As Long) As t7Segment
    30.      Select Case Number
    31.         Case 0
    32.             GetLedNumber = New7Segment(0, 1, 1, 1, 1, 1, 1, 0)
    33.         Case 1
    34.             'etc
    35.         Case Else
    36.             GetLedNumber = New7Segment(0, 0, 0, 0, 0, 0, 0, 0)
    37.     End Select
    38. ENd Function
    39.  
    40. 'builds the saved led setup for each number
    41. Sub Initialize()
    42.     LedNumber(0) = New7Segment(0, 1, 1, 1, 1, 1, 1, 0)
    43.     'etc
    44. 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. #6
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,784

    Re: Simulating a seven segment display

    jeroen79, read the messages in the thread before you post, if you look at the second post in this thread it has a link to here http://www.vbforums.com/showthread.p...07#post3220107

    And that thread was closed for posting...

    If you click on that link, you will find THIS:
    Quote 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
  •  



Featured


Click Here to Expand Forum to Full Width