» codelab : http://codelab.fr/accueil » Forum : Processing : http://codelab.fr/processing » voie série Processing --> Arduino : http://codelab.fr/5546 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : voie série Processing --> Arduino |
léo_le_vilain — 2015-01-27 13:38:45 |
Bonjour, Code Arduino char val; // Data received from the serial port char x; void setup() { pinMode(ledPin, OUTPUT); // Set pin as OUTPUT Serial.begin(9600); // Start serial communication at 9600 bps } void loop() { if (Serial.available()) { // If data is available to read, val = Serial.read(); // read it and store it in val } if (x>185){ pinMode(13,LOW); } else{ pinMode(13,HIGH); } } |
matheynen — 2015-01-27 19:27:38 |
Si tu veux éviter tous ces problèmes tu peux utiliser la librairie Vsync qui est vraiment bien concue. |