prog:processing:arduino
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
prog:processing:arduino [2019/01/31 14:12] – jbpuel | prog:processing:arduino [2019/01/31 14:18] (Version actuelle) – jbpuel | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Interface Processing - Arduino ====== | ====== Interface Processing - Arduino ====== | ||
- | Tuto chez Sparkfun : http:// | + | Tuto chez Sparkfun : http:// |
Référence ici : http:// | Référence ici : http:// | ||
Ligne 7: | Ligne 7: | ||
Donc, charger le firmware StandardFirmata sur l' | Donc, charger le firmware StandardFirmata sur l' | ||
- | Premier exemple, un simple blink commandé dans du code Processing : | + | Premier exemple, un simple blink commandé dans du code Processing : |
+ | |||
+ | < | ||
+ | import processing.serial.*; | ||
+ | import cc.arduino.*; | ||
+ | |||
+ | Arduino arduino; // déclaration de la carte | ||
+ | int ledPin = 11; // une led (+ 1 résistance) connectée sur la pin 11 | ||
+ | |||
+ | void setup() // initialisations | ||
+ | { | ||
+ | // println(Arduino.list()); | ||
+ | arduino = new Arduino(this, | ||
+ | arduino.pinMode(ledPin, | ||
+ | } | ||
+ | |||
+ | void draw() // boucle principale | ||
+ | { | ||
+ | arduino.digitalWrite(ledPin, | ||
+ | delay(1000); | ||
+ | arduino.digitalWrite(ledPin, | ||
+ | delay(1000); | ||
+ | } | ||
+ | </ |
prog/processing/arduino.txt · Dernière modification : 2019/01/31 14:18 de jbpuel