import Phidgets.*; import Phidgets.Events.*; PhidgetServo phid; float x,y; float step; void setup(){ framerate(20); step = 1; phid = new PhidgetServo(); phid.OpenRemoteIP("localhost",5001,11033,"pass"); } void draw(){ } void keyPressed() { if(phid.GetIsAttached() && key == CODED) { if (keyCode == UP) { phid.SetMotorPosition(0,phid.GetMotorPosition(0)+step); } else if (keyCode == DOWN) { phid.SetMotorPosition(0,phid.GetMotorPosition(0)-step); } else if (keyCode == LEFT) { phid.SetMotorPosition(1,phid.GetMotorPosition(1)+step); } else if (keyCode == RIGHT) { phid.SetMotorPosition(1,phid.GetMotorPosition(1)-step); } println(phid.GetMotorPosition(0) + " - " + phid.GetMotorPosition(1)); } }