Processing Forum
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int motor1 = 3;
int motor2 = 5;
int motor3 = 9;
int motor4 = 10;
int pulseWidth = 200;
void setup() {
size(100,100);
background(0);
println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 9600);
arduino.pinMode (motor1, Arduino.OUTPUT);
arduino.pinMode (motor2, Arduino.OUTPUT);
arduino.pinMode (motor3, Arduino.OUTPUT);
arduino.pinMode (motor4, Arduino.OUTPUT);
}
void draw() {
arduino.analogWrite(motor1, pulseWidth);
arduino.analogWrite(motor2, pulseWidth);
arduino.analogWrite(motor3, pulseWidth);
arduino.analogWrite(motor4, pulseWidth);
}