Problem on exporting

edited September 2014 in Library Questions

Hello. I am having problems with exporting a program with serial library. When i run the program in Processing it works fine, but when i open .exe file, a window opens up bot the program that i wrote is not there... I am using import processing.serial.*; to get the temperature from the arduino and display it on the screen, Here is my code:

    import processing.serial.*;
    Serial port;
    String temp = "";
    String vlaz = "";
    String data = "";
    int index = 0;
    PFont font;

    void setup()
    {
      size(400,400);
      port = new Serial(this, "COM5", 9600);
      port.bufferUntil('.');
      font = loadFont("AgencyFB-Bold-200.vlw");
      textFont(font,200);
    }

    void draw()
    {
      background(0,0,0);
      fill(46,209,2);
      text(temp,50,175);
      fill(0,102,153);
      text(vlaz,50,370);
    }

    void serialEvent (Serial port)
    {
      data = port.readStringUntil('.');
      data = data.substring(0, data.length() - 1);

      index = data.indexOf(",");

      temp = data.substring(0,index);
      vlaz = data.substring(index + 1, data.length());
    }

Here is the window in Processing working: http://prntscr.com/4pa6tk But when i run the . exe file it just opens the window with the backgroud color that i picked when i was making export: http://prntscr.com/4pa71h And it also is not showing "stop" button at the bottom. I tested one other program with no serial and it worked at the export... so i think something is wrong with serial library, or i can be wrong.

Answers

Sign In or Register to comment.