hello everybody,
I'd like to control several servos with pure data and arduino. For the moment I'm able to control one servo with this simple arduino sketch:
#include <Servo.h>
Servo myservo1;
int incomingByte = 0; // for incoming serial data
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
myservo1.attach(3);
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
myservo1.write(incomingByte);
}
}
in PD, the patch is a simple HSLIDER 0-->180 linked to the object comport 4 9600
I read on the net that to control multiple servos I need to write a communication protocol, ... I'm a noob and don't know how to do this, does anybody know how to?
thank you
manu