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.
Page Index Toggle Pages: 1
processing problem (Read 880 times)
processing problem
Oct 27th, 2008, 4:22am
 
Hello,
I am connecting a simple sketch on arduino to processing, my processing code looks just fine, but I seem to have some sort of a java or server problem.
I am using a Macbook pro OSX 10.5.5 with the latest java installed. arduino 10 and processing 0154.

this is the error message I get:


processing.app.debug.RunnerException: unexpected token: void

at processing.app.Sketch.preprocess(Sketch.java:1369)

at processing.app.Sketch.build(Sketch.java:1478)

at processing.app.Sketch.compile(Sketch.java:1178)

at processing.app.Editor.handleRun(Editor.java:1645)

at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:321)

at java.awt.Component.processMouseEvent(Component.java:5599)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)

at java.awt.Component.processEvent(Component.java:5367)

at java.awt.Container.processEvent(Container.java:2010)

at java.awt.Component.dispatchEventImpl(Component.java:4068)

at java.awt.Container.dispatchEventImpl(Container.java:2068)

at java.awt.Component.dispatchEvent(Component.java:3903)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3933)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)

at java.awt.Container.dispatchEventImpl(Container.java:2054)

at java.awt.Window.dispatchEventImpl(Window.java:1801)

at java.awt.Component.dispatchEvent(Component.java:3903)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
69)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190
)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
processing.app.debug.RunnerException: unexpected token: void

at processing.app.Sketch.preprocess(Sketch.java:1369)

at processing.app.Sketch.build(Sketch.java:1478)

at processing.app.Sketch.compile(Sketch.java:1178)

at processing.app.Editor.handleRun(Editor.java:1645)

at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:321)

at java.awt.Component.processMouseEvent(Component.java:5599)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)

at java.awt.Component.processEvent(Component.java:5367)

at java.awt.Container.processEvent(Container.java:2010)

at java.awt.Component.dispatchEventImpl(Component.java:4068)

at java.awt.Container.dispatchEventImpl(Container.java:2068)

at java.awt.Component.dispatchEvent(Component.java:3903)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3933)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)

at java.awt.Container.dispatchEventImpl(Container.java:2054)

at java.awt.Window.dispatchEventImpl(Window.java:1801)

at java.awt.Component.dispatchEvent(Component.java:3903)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
69)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190
)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


This is part of my processing code - the beginning:


import processing.serial.*;
import processing.net.*;
Server myServer;
myServer = new Server(this, 8080);
int ZERO = 0;
 
// variables for serial connection, portname and baudrate have to be set
 Serial port;
 String portname = "/dev/tty.usbserial-A9003VR1";  
 int baudrate = 9600;
 int value = 0;
 String buf="";
 int value1=0;  


void setup(){
 // set size and framerate
 size(xWidth, yHeight);
 //frameRate(fr);
 // establish serial port connection      
 println(port.list());
 port = new Serial(this, portname, baudrate);
 // create DisplayItems object
 di = new DisplayItems();
}


how can it be fixed ?
thank you.
Re: processing problem
Reply #1 - Oct 27th, 2008, 11:07am
 
You can't do:

Server myServer;
myServer = new Server(this, 8080);

in that mode of processing, you need to put the "myServer = ..." line into setup()
Page Index Toggle Pages: 1