prog:processing:arduino
                Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| prog:processing:arduino [2019/01/31 14:11] – créée 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:// | 
| - | + | ||
| - | Seconde tentative avec ce tuto : http:// | + | |
| Référence ici : http:// | Référence ici : http:// | ||
| Ligne 9: | 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.1548943875.txt.gz · Dernière modification :  de jbpuel
                
                