Hi there I am a newbie to Pd and Arduino but I have an Uno and a question for you. I followed this article - http://nf-interactive.blogspot.ie/2011/02/arduino-data-to-pure-data.html - successfully getting a Force sensor communicating to the Arduino and my Pd patch however I would like to run multiple sensors (three for now!) simultaneously and I have looked for a simple explanation but I cannot find one how is this done?
Here is what I thought my Arduino code should look like -
int powerPin = 8;
void setup() {
Serial.begin(9600);
pinMode(powerPin, OUTPUT);
}
void loop() {
int sensorValueA0 = analogRead(A0);
int sensorValueA1 = analogRead(A1);
int sensorValueA5 = analogRead(A5);
digitalWrite(powerPin, HIGH);
sensorValueA0 = sensorValueA0 / 4;
sensorValueA1 = sensorValueA1 / 4;
sensorValueA5 = sensorValueA5 / 4;
Serial.write(sensorValueA0);
Serial.write(sensorValueA1);
Serial.write(sensorValueA5);
delay(70); // delay in between reads for stability
}
I understand that this would output analog values one after another through the serial port into the comport. For example sensor 1 2 and 3 could read the following: 0 59 243 0 65 246 0 80 250. This is what I am assuming is happening from watching the Arduinos serial monitor?
Basicly I would like to have [comport] have 3 outputs to 3 number boxes which will manipulate my musical patch - but I am not sure how to do this.
Thank you for any help!