Seven segment Display

Hi,
My project is to do with a petrol pump and the simulation of it.
My problem is that i need to create a seven segment display in an interface containing Jbuttons that when pressed will run methods.
I have the Jbuttons created and there should be(which there currently isnt) a counter shown next to the button for the following method in the Jframe
public void StartSqueezing()
NozzleReady=false;
NozzleInUse=true;
NozzleNotInUse=false;
do{
if( LitresDispensedPerTransaction < PetrolLimit)
LitresDispensedPerTransaction = (LitresDispensedPerTransaction + 0.10);
try {
Thread.sleep(1000) ;
//1000 millisecs
catch(InterruptedException ex) {
while (NozzleInUse = true );
I also have this further down- getPrice is just another method in the code.
private void makeFrame()
frame = new JFrame("Peter Pump");
Container contentPane = frame.getContentPane();
contentPane.setLayout(new GridLayout(3, 2));
JButton getPrice = new JButton ("getPrice");
contentPane.add(getPrice);
getPrice.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { getPrice(); }
I need a seven segment display that will count up the number of litres of fuel dispensed when the Jbutton representing the above "StartSqueezing" method is pressed. The counter should move up by 0.1 each time.
I am by no means asking anybody to do this for me, i would just like some help and to be pointed in the right direction for what i need to read up about.
Many Thanks,
Edward

Darryl,
He is a guy at my college, its ok nobody likes him anyway :P i will just completely ignore what he said as he is actually no better than i am haha.
Anyway, back to something that matters.....
public void StartSqueezing()
        NozzleReady=false;
        NozzleInUse=true;
        NozzleNotInUse=false;
        Runnable run1 = new Runnable() { public void run()
         do{
           LitresDispensedPerTransaction =+ 0.10;
          try { Thread.sleep(200);}
             catch(InterruptedException ex) {}
         while (NozzleInUse == true ); 
     Thread thrd1 = new Thread(run1);
     thrd1.start();       
    }I have put this is the action listener of a button and it wont work....any ideas???
Edward

Similar Messages

  • 5-bit binary in 2 seven segment displays?

    How to display a 5-bit binary in 2 seven segment displays using gates or components available in multisim?
    Attachments:
    sev seg.ms12 ‏408 KB

    Hello,
    It seems you already have a working file. The way a seven segment display works is by lighting each individual light of a the display (there's 7 lights for number 8 for example). You can use a driver or figure out a logic using digital gates. If oyu need information on this, there are lots of examples on the web and youtube. There's also samples in the Multisim samples folder involving seven segment displays that you can see.
    Kind regards,
    Miguel V
    National Instruments

  • Java 'seven segment display' and problems, can anyone help me

    import java.awt.*;
    import java.applet.*;
    import javax.swing.*;
    import javax.swing.JButton.*;
    import javax.swing.JFrame.*;
    public class test extends Applet{
         Font bigFont;
         Color redColor;
         Color bgColor;
         Button clickOnMe;
         Button clickOnMe2;
         int value = 0000;
         int value2 = 0000;
         int segmentArray[][] = {{0,0,1,0,0,1,0},{1,0,1,1,1,0,1},{1,0,1,1,0,1,1},{0,1,1,1,0,1,0},{1,1,0,1,0,1,1},{1,1,0,1,1,1,1},{1,0,1,0,0,1,0},{1,1,1,1,1,1,1},{1,1,1,1,0,1,0},{1,1,1,0,1,1,1}};
         int optiontest = 0;
         public void init(){}
         if (optiontest == 1)
         clickOnMe = new Button("Diesel");
         add ("left",clickOnMe);
         clickOnMe2 = new Button("Petrol");
    add ("centre",clickOnMe2);
         bigFont= new Font("Arial",Font.BOLD,16);
         bgColor=Color.white;
         setBackground(bgColor);
         } public void init stop()
    public boolean action (Event e, Object args)
    { if (e.target == clickOnMe)
                   optiontest ++;
    if (e.target == clickOnMe2)
              value2 ++;
    repaint();
    return true;
         public void paint (Graphics g)
              g.setColor(Color.black);
              g.drawString("Cost" + value, 275, 170);
    g.drawString("Cost" + value2, 275, 200);
              g.setColor(Color.red);
              g.drawRect(300, 300, 150, 150);
              g.drawRect(270, 150, 210, 200);
              g.drawRect(270, 270, 210, 150);
              g.drawRect(270, 270, 450, 270);
         g.fillRect(270, 270, 210, 270);
              g.drawRect(480, 320, 240, 220);
              g.setColor(Color.black);
    public boolean stop()
              if (optiontest < 10){
              // seg 1
                   if (segmentArray[optiontest ][0] == 1){
                        g.drawRect(100, 100, 50, 0);
              // seg 2
                   if (segmentArray[optiontest ][1] == 1){
                        g.drawRect(100, 100, 0, 50);
              // seg 3
                   if (segmentArray[optiontest ][2] == 1){
                        g.drawRect(150, 100, 0, 50);
              // seg 4
                   if (segmentArray[optiontest ][3] == 1){
                        g.drawRect(100, 150, 50, 0);
              // seg 5
                   if (segmentArray[optiontest ][4] == 1){
                        g.drawRect(100, 150, 0, 50);
              // seg 6
                   if (segmentArray[optiontest ][5] == 1){
                        g.drawRect(150, 150, 0, 50);
              // seg 7
                   if (segmentArray[optiontest ][6] == 1){
                        g.drawRect(100, 200, 50, 0);
              // When the number is biggest than 10 and less than 100
              if (optiontest >10 && optiontest < 100)
                   // Units \/
                   // seg 1
                   if (segmentArray[optiontest - 10][0] == 1){
                        g.drawRect(100, 100, 50, 0);
              // seg 2
                   if (segmentArray[optiontest -10][1] == 1){
                        g.drawRect(100, 100, 0, 50);
              // seg 3
                   if (segmentArray[optiontest -10][2] == 1){
                        g.drawRect(150, 100, 0, 50);
              // seg 4
                   if (segmentArray[optiontest -10][3] == 1){
                        g.drawRect(100, 150, 50, 0);
              // seg 5
                   if (segmentArray[optiontest -10][4] == 1){
                        g.drawRect(100, 150, 0, 50);
              // seg 6
                   if (segmentArray[optiontest -10][5] == 1){
                        g.drawRect(150, 150, 0, 50);
              // seg 7
                   if (segmentArray[optiontest -10][6] == 1){
                        g.drawRect(100, 200, 50, 0);
                   // The tens section \/
              // seg 1
                   if (segmentArray[optiontest / 10][0] == 1){
                        g.drawRect(100 - 70, 100, 50, 0);
              // seg 2
                   if (segmentArray[optiontest / 10][1] == 1){
                        g.drawRect(100 - 70, 100, 0, 50);
              // seg 3
                   if (segmentArray[optiontest / 10][2] == 1){
                        g.drawRect(150 - 70, 100, 0, 50);
              // seg 4
                   if (segmentArray[optiontest / 10][3] == 1){
                        g.drawRect(100 - 70, 150, 50, 0);
              // seg 5
                   if (segmentArray[optiontest / 10][4] == 1){
                        g.drawRect(100 - 70, 150, 0, 50);
              // seg 6
                   if (segmentArray[optiontest /10][5] == 1){
                        g.drawRect(150 - 70, 150, 0, 50);
              // seg 7
                   if (segmentArray[optiontest /10][6] == 1){
                        g.drawRect(100 - 70, 200, 50, 0);
    }

    Please use the CODE tags when you post your code. It makes it much more readable. Based upon your Subject, I can't understand your problem. Please be more specific and explain your difficulty in your message.

  • Seven segment led display with arduino pin configurat​ions

    iam new here.. i am trying to dipaly a numbers on led seven segment display. but i dont know how to cinfigure pin numbers with arduino examples...
    can anyon eexplain the pin configuration in sevensegment led.

    Hi anilkun,
    in the linked example you see that picture. It shows all the needed wires to connect Arduino with 7segment LED.
    What else do you need?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Combinational logic for BCD seven segment

    HI all,
    I have to design the combinational logic for BCD to seven segment display using only And, Or and Not gates and simulate it using the multisim software. I had come out with the truth tables, kmaps and finally i got all the SOP for each of the segments (a - g).
    Now i have a problem, using multisim i do not know how to simulate the output. Am i going to draw all the logic diagram for a to g, and how am i going to combine them together?
    What other components do i need to proceed with the simulation? Please advice, thanks in advance!

    I'm not sure what SOP means, but I am very, very familiar with this project.
    Here is a file that sets up a basic structure for you so you can see how it works. I used a Common-anode 7-segment display since those seem to be more common in school kits, which makes the final gate outputs active low. I've only done the "A" segment for an example. You may notice that the gates I have are different than what you get with Karnaugh mapping, because I used the Quine-McCluskey method that Multisim's Logic Converter can produce. It makes for less gates, but is not a method you really want to do manually. If you are doing a school assignment, I would advise against using the Quine-McCluskey result, because an instructor will tear you apart if it doesn't work and you can't show your proofs, so don't forget to remove my gates!
    Ryan R.
    R&D
    Attachments:
    7-Segment Driver Array Starter.ms10 ‏101 KB

  • Do you have Sequential Binary counter with J K flip-flops and 7 segment display ?

    do you have Sequential Binary counter with J K flip-flops and 7 segment display ?

    Hi,
    You should post what you have done so far and where you are having trouble.  If you only post a description you won't get much help on this board.
    Tien P.
    National Instruments

  • 7 Segment Display OCR

    Hi all,
    I have a 7 segment number image and I want to convert the image into text using OCR. I am already doing this with some other tool, but it is not able  to properly do OCR for 7 segment display image. Can anyone suggest me a good OCR software which can read 7 segment display number which I can call through LabVIEW?
    I don't have the Vision development module, so I can't use the IMAQ VIs.
    Thanks.
    Fragger Fox.
    -FraggerFox!
    Certified LabVIEW Architect, Certified TestStand Developer
    "What you think today is what you live tomorrow"

    Just googled the image I was talking about....and attached it
    -FraggerFox!
    Certified LabVIEW Architect, Certified TestStand Developer
    "What you think today is what you live tomorrow"
    Attachments:
    7 seg display.JPG ‏21 KB

  • NETRA  7 segment display H E L P, any ideas???

    when turn on the Netra t1 105 inside diplay (7 segment leds) display a sequence H, E, L, P but i no have a idea why happen this, any idea???
    thanks
    sorry my bad english

    The Netra t1 105 documentation only describes the LEDs visable on the outside of the case.
    The Netra t1 105 conains a SPARCengine CP1500 board, for which detailed documention is available at:
    http://www.sun.com/oem/products/manuals/
    From http://www.sun.com/oem/products/manuals/806-2104-03.pdf
    <table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td class="SmallText"><b>Quote:</b></td></tr><tr><td class="quote">
    The characters in the LED displayed by OBP indicate the following:
    O (The letter O ) OBP is currently executing.
    E RED state exception encountered in OBP.
    b Solaris boot has taken place.
    H, E, L, and P This sequence (with each letter flashed at a 4-second interval) is initiated if the system is at the ok prompt for more than two minutes after power-on, without booting. It does not appear after Solaris has booted.
    </td></tr></table>

  • Segment Display in IDOC Type MBGMCR02

    Hi,
    I am creating a goods movement and an IDOC gets created. But when I see the IDOC with WE02 not all segments are displayed. What should be done to see a field ITEM_TEXT in the segment?
    Thanks & Regards,
    YJR.
    Message was edited by: YJR

    Hi,
    Yeah that is fine but now the problem is I have created a conversion Rule where I use the BATCH as the imput and I would retrieve the SIZE and this value is supposed to be populated in ITEM_TEXT and this creation of conversion Rule is done and it works. But when I try to see it in WE02 the field ITEM_TEXT itself is not visible.
    How should this be handled to see the field ITEM_TEXT in the first place itself.
    Thanks & Regards,
    YJR.

  • Varied adc input to be displayed on a 7 segment display

    Hi,
    I constructed an ADC (8bit) using LM339 and a variable resistor. I want to have a display on a 7segment using 7490ic and 7447ic by varying the variable resistor. Also, i would like to know or better if instead counting only upwards when the variable resistor is varied or both up and down.
    Theoritically, the circuit should work but am having difficulty piecing the ADC to the "display end".
    Please find attached.
    Attachments:
    Design7.ms11 ‏275 KB

    Hi there,
    The ground has been added, but not functioning as is supposed to. The objective is to get the 7segment display counting as the varaible resistor is varied. But once the circuit is powered it just reads "7" and doesnt move. I replaced the ADC part with normal switches and it functioned as it was supposed to .
    Br,
    Qwesy
    Attachments:
    Design5.ms11 ‏228 KB

  • 7-Segment Display Need Help Immediately!! Please!!!

    I can't figure out how I build this at all. I need so much help please! If anyone has any idea it would be great. I can't figure out how to make a keyboard on here or how to use the encoder and decoder correctly. Please help me.
    Thank you much appreciated. 
    Attachments:
    Project_3.doc ‏113 KB

    Hi,
    I didn't look through the entire assignment but I suggest you look up the datasheet for the 74147 and 7447.
    Tien P.
    National Instruments

  • How can i display 7 segment dispay on front panel using any kind of input

    Hi,
    I need help..!! I need to dispay the numeric data in 7 segment format. Is it possible to do in labview?

    you need to display the number onto a 7 segment display?
    i think you would need sometype of microcontroller board like the AVR or the aurdino. and use the visa usb port to display out into the 7 segment display.
    i am new to this too. but that's what i would do.
    i hope someone with more expertise can  give better advice.
    Arduino and 7 Segment LED
    7 Segment LED
    The
    seven segment display is a pretty simple device.  Its actually just 7
    LEDs (8 really including the decimal point) arranged so different
    combinations can be used to make numerical digits.  This tutorial will
    show you how to wire one up and drive it with an Arduino.
    Message Edited by krispiekream on 07-23-2009 11:48 AM
    Best regards,
    Krispiekream

  • How do I make a sixty second timer which resets at 60 and goes to 00?

    I am trying to create a 60 second timer (file attached) which will reset at 60 and go to 00.
    Currently, the two seven segment displays displaying the digits will go from 60 to 01. If I replace the output of U14D with that of U14C, it will reset from 59 to 00.
    Any help is appreciated, thanks!
    Attachments:
    60 Second Timer.ms12 ‏314 KB

    Hi JarJariggs
    There is probably a small logic error somewhere in the reset. Your 0-9 counter works fine, so, when reseted, whocul go back to 0, not 1. Your design is similar to the one in the next page, maybe you can compare the logic in both circuits to help you find the error.
    Page:    60 Second Timer
    WenR

  • Digital stopwatch circuit not working/running smoothly

    I made the following Digital stopwatch circuit  using IC 7490, 7448 and cathode seven segment display on multisim and the transition between 2 and 3 and some other states isnt  smooth or is getting stuck. What modifications can be done to run this circuit perfectly ?
    Attachments:
    MM SS stopwatch 3.ms11 ‏256 KB

    Hi there,
    In Multisim go to Simulate>>Mixed-Mode Simulation Settings and select Use Real pin models. This mode requires power and digital ground which you already have in the schematic.
    Regards,
    Fernando D.
    National Instruments

  • Digital clock reset problem with 74193N

    Hi, i'm designing a digital clock circuit.
    However, i faced problems during reset part.
    when i tried to reset on 3(U11) with 1 NAND gate and 2 NOR gates,
    i think i don't make mistake to reset with 0011(U3),how come the 3 will also appear on the seven-segment display?
    Well,i also wonder how can i reset  the other seven-segment display(U9) to show the following sequences:
    0,1,2,3,4,5,6,7,8,9,0,1,2,3,0,1,2,3,4,5,6,7,8,9,0,1,2,3,0.. 
    Lastly, is that possible to configure the transmition speed in multisim 11.0?
    Thanks.. 
    Attachments:
    NEW140712.ms11 ‏363 KB

    Hi,
    There were a few problems with the circuit which is why the clock was not reseting at 3. I have modified the file. Please take a look and see. You will need to add a buffer between the second input and the AND gate because otherwise, the gate will trigger before the output has actually reached the desired state.
    I had to edit the delay time in the buffer to make it work of this circuit. To edit the delay time, double-click the Buffer and under the Value tab, click on Edit Model. You can change the rise time and fall time from this window.
    Hope this helps.
    Regards,
    Tayyab R,
    National Instruments.
    Attachments:
    NEW140712 mod.ms11 ‏545 KB

Maybe you are looking for