We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › Exporting Serial Sketch as App
Page Index Toggle Pages: 1
Exporting Serial Sketch as App (Read 949 times)
Exporting Serial Sketch as App
Oct 14th, 2009, 4:08pm
 
Hey! This is my first post here, woo! This might be a rookie question, sorry if that's the case!

Anyway, I've made a little indicator (a flag that pops up) with my Arduino which is triggered when it receives serial data. Now I want to be able to control this via AppleScript (on OS X 10.6.1) so I decided to make a dead simple Processing sketch to send the serial string and then export that as an application.

But... The sketch works fine when I run it in Processing, however the exported application doesn't. In fact the only thing that happens is that I get a menu called flag (after the sketch), nothing else. I've tried with other sketches that are not based on the Serial library and they seem to work fine so I guess there is a problem with this?

The sketch I'm exporting is:

Code:
import processing.serial.*;

Serial myPort;
int i = 0;

void setup () {

 size(100, 100);        
 myPort = new Serial(this, Serial.list()[0], 57600);
 
}

void draw() {

   myPort.write('A');
   i++;
   if (i>30) {
     exit();
   }

}
Page Index Toggle Pages: 1