// send signal to ATtiny44 (Arduino IDE), via SoftwareSerial // signal is produced by moving ControlP5 "slider" with mouse, // X-potision of a circle (ellipse) represents the signal value. import controlP5.*; ControlP5 cp5; import processing.serial.*; Serial port; int sliderX= 200; void setup() { size(256, 150); cp5 = new ControlP5(this); cp5.addSlider("sliderX") .setPosition(50, 100) .setSize(130, 30) .setRange(0, 255) // .setNumberOfTickMarks(5) ; println("Available serial ports:"); // if using Processing 2.1 or later, use Serial.printArray() printArray(Serial.list()); // Uses the first port in this list (number 0). Change this to select the port // corresponding to your Arduino board. The last parameter (e.g. 9600) is the // speed of the communication. It has to correspond to the value passed to // Serial.begin() in your Arduino sketch. port = new Serial(this, Serial.list()[5], 9600); // If you know the name of the port used by the Arduino board, you can specify // it directly like this. //port = new Serial(this, "COM1", 9600); } void draw() { background(0, 255, 255); ellipse(sliderX, 50, 50, 50); port.write(sliderX); delay(50); }