i'm trying to make my cursor move with processing code. So i'm not trying to get its coördinates or something else whatsoever, i just want to move the cursor itself.
I found this code on the forum (from 2008)
int xx = 10, yy = 10;
Robot robby;
void setup()
{
size(500, 500);
try
{
robby = new Robot();
}
catch (AWTException e)
{
println("Robot class not supported by your system!");
exit();
}
}
void draw()
{
xx = (xx + 2) % width;
yy = (yy + 2) % height;
// Might need to confine to sketch's window...
robby.mouseMove(xx, yy);
}
But i can't get it to work, it says it does not know a class named robot..
is there another way to make this work? or am i doing something wrong?
I wrote a bit of code to communicate with an arduino through serial communication, and everything works well (I can receive everything without problems etc), but now I want to be able to 'redefine' the serial port while the sketch is running.
I use controlP5 as GUI, and when someone selects an item from a dropdownlist (baudrate or port) then the serial port should be redefined with the current (wanted) settings.
this is what I use (this is not all the code, just the important things)
i made this little code that should execute the drawScreen() function when tempBuff equals "C".
I've tried a lot, but nothin seems to work. i've read that stringToCheck.equals(patterToCheck) should work, but it does not as i want it to... it always executes the else{}, while in the serial monitor i get that "C" printed out
and no it's not because of the drawScreen function, i've tested it without the if statement and then it works
i'm fairly new to processing, and i'm having some problem with a bunch of code. i'm working with strings, as you can see in the code, but it seems that i con't just add an item (string in this case) to the array by just giving it the next number in line...
What i mean is that i want to add a string to String strCmds[] by doing strCmds[strCmds.length] = "Hello"