We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have updated java, and when I run my program in processing, it works fine, but when I export it, it won't launch :( Although some basic example from processing works fine when exported, but mine won't launch. I think it's because there's something on the program? Anyone knows how to fix it? It would be a very big help for me. Here's the code,
import processing.serial.*;
Serial port;
void setup() {
port = new Serial(this, Serial.list()[0], 9600); // Open the port that the Arduino board is connected to, at 9600 baud
}
void draw() {
String onoroff[] = loadStrings("C:/xampp/htdocs/DoorlockTest/LEDstate.txt"); // Insert the location of your .txt file
print(onoroff[0]); // Prints whatever is in the file ("1" or "0")
if (onoroff[0].equals("1") == true) {
println(" - TELLING ARDUINO TO TURN LED ON");
port.write('H'); // Send "H" over serial to set LED to HIGH
} else {
println(" - TELLING ARDUINO TO TURN LED OFF");
port.write('L'); // Send "L" over serial to set LED to LOW
}
delay(1000); // Set your desired interval here, in milliseconds
}
anyway this isn't my work, I just copy pasted it from somewhere in google, credits to the programmer.
Answers
:(
First, you should read To newcomers in this forum: read attentively these instructions, about formatting.
What version of Processing do you use? I believe the latest versions have made improvements in the field of exports. But sketches using the serial port can be harder to export, try first on simpler sketches, to see if it works.
Same thing happens to one of my sketches that use these libraries:
I am using the newest version of Proce55ing (2.2.1)
@PhiLho, @mcspud: I'm using the 2.2.1 version of processing sir, I also tried to export basic samples of processing, and it works fine and btw, what I meant is that the application that I exported wont launch. I think I believe that using serial port can be harder to export, are there any steps for it to work? Should I use the older version?Anyway, Thanks a lot for responding!
Same thing with me, it exports, but doesn't run when double clicked. 2.0.3 works however.
@mcspud If you use the 32-bit version of Processing 2.0.3, it is a known bug, fixed in later versions (AFAIK).
If you use 2.2.1, check if both 32 and 64 bit versions don't work. On my system only the 32 bit version works but not the 64 bit... (It won't even attempt to export to OSX and Linux).
I'm on a 32bit system window 7. Both 32 and 64 won't work. :(
Same thing with me, it exports, but doesn't run when double clicked. I am using the newest version of Processing (2.2.1). i use Chinese text Font and text(Chinese);
New released version of processing worked for this. :D
I have the same problem:
Anyone have a solution to this, yet?
@G_Luv Just like what ive said earlier, new released version of processing worked for this problem, they fixed it already. Download the new version (3.0a2).
Ah, I thought you meant v2.2.1 (the latest release version).
It works under 3.0a2.
Thanks!
I'm having a similar issue (with Processing 2.2.1 and with 3.0a3) I'm running Processing 2.2.1 along with SimpleOpenNI 1.96 (based on instructions at http://shiffman.net/p5/kinect/). I modified the DepthImage example sketch and added file writing (code below).
I'm trying to output the depth data from Kinect to .txt files in a folder of my choice. In the Processing IDE, the sketch runs fine; the depth is written to the files correctly.
However I would like this functionality in an .exe file so that another program can run this .exe and read from those files, at run time. Export functionality in Processing IDE runs without errors and I get both win32 and win64 application folder. But if I execute .exe present in either one of them, nothing happens; I cannot see any errors anywhere. Even if I select "Present Mode" while exporting, only a gray screen appears but I cannot see any files being written to the path I supply. Toggle various selections (PresentMode/Export java) on the Export options windows hasn't helped.
I also tried to use savePath() because someone else (not using a kinect application) was able to write data into folders using that. But it did not work for me.
Following is my sketch that works correctly in the IDE: