I have been using this code below in my sketch, but it causes processing to stop when it is combined with serial communication to an arduino... The serial part of my sketch works fine as long as I remove all of the code below... if I leave it in, it will error out about 4 out of 5 times... then work fine until I run it again... Is there a chance that I am not setting up the robot class correctly or that the serial class is wrong but somehow works because robot isnt there???
import java.awt.Robot;
import java.awt.AWTException;
Robot robby;
void setup()
{
//robot setup
try
{
robby = new Robot();
}
catch (AWTException e)
{
println("Robot class not supported by your system!");
exit();
}
robby.mouseMove(screenResX/2, screenResY/2); //test line to move cursor
}