I am in a project of robotic arm in my and I want it to control via usb mouse using processing but it seems that i can control two servos. But I need to control three more. I have driven two servos successfully using this code
import processing.serial.*;
Serial port;
void setup()
{
size(180, 180);
println("Available serial ports:");
println(Serial.list());
port = new Serial(this, Serial.list()[1], 9600);
}
void draw()
{
port.write(mouseX); //this drives the servo in any angle between 0 to 180
port.write(mouseY); //this drives the servo in any angle between 0 to 180
}
Is there anyway where i can draw 5 rectangle and control them individually to drive the servos ????