Hi,
Finally, I can receive my 3 variables in Arduino just by making exactly what jb4x said in his first post!!! (changing the speed of connection, use recevieData…)
see the Arduino Code below
Setpoint = 0;
stateB= 0;
stateD= 0;
}
void loop() {
// read the sensor value: (the potar)
// int sensorReading = analogRead(A0);
// send sensorReading to Serial (to receive it in Processing)
//Serial.print(analogRead(sensorReading));
// _____________________________________________
// see if there's incoming serial data: (from processing)
receiveData();
Setpoint = map( w1, 0,255, -100,100); //1er
stateB= map( w2, 0,200, -100,100);
stateD= map( phiV, 0,255, -100,100); // 3eme
// Serial.print ("Setpoint :"); Serial.println (Setpoint); we can't see Setpoint when Processing works because the Serial is busy
void receiveData() {
if (Serial.available() > 0) {
w1= Serial.parseInt();
w2 = Serial.parseInt();
phiV = Serial.parseInt();
Serial.read();
}
}
in processing there is no effect if I do this
// arduinoport.write(values[0] + “;” + values[2] + “;” + values[1] + “;”);
arduinoport.write(values[1] + " " + values[2] + " " + values[0] + " ");
To finish I want to send one or several value from Arduino to Processing with the same both program.
I’ll come back if I have any problem.
Thanks Jb4x to be patient, your project A universal ambilight looks pretty good and useful to learn making nice project.
Thanks to M. Whahahahaha