Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


logiciels:serial-processing:accueil

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
logiciels:serial-processing:accueil [2016/05/25 10:25]
resonance [Code Arduino]
logiciels:serial-processing:accueil [2018/01/22 11:19]
resonance ancienne révision (2016/05/25 10:28) restaurée
Ligne 69: Ligne 69:
  
 void draw() { void draw() {
 +
 +  // Draw circles
   fill(#ff0000);   fill(#ff0000);
   ellipse(x, v1, 5, 5);   ellipse(x, v1, 5, 5);
-   
   fill(#00ff00);   fill(#00ff00);
   ellipse(x, v2, 5, 5);   ellipse(x, v2, 5, 5);
    
 +  // Update x position
   x++;   x++;
-  //v1++; 
-  //v2--; 
      
   // Refresh screen   // Refresh screen
Ligne 84: Ligne 84:
     x = 0;     x = 0;
   }   }
-   
-  //if (v2 < 0) v2 = 255; 
-  //if (v1 >255) v1 = 0; 
 } }
  
Ligne 93: Ligne 90:
 // method in the setup(): // method in the setup():
 void serialEvent(Serial myPort) { void serialEvent(Serial myPort) {
 +
   // read the serial buffer:   // read the serial buffer:
   String myString = myPort.readStringUntil('\n');   String myString = myPort.readStringUntil('\n');
 +  
   // if you got any bytes other than the linefeed:   // if you got any bytes other than the linefeed:
   myString = trim(myString);   myString = trim(myString);
 +  
   // split the string at the commas   // split the string at the commas
   // and convert the sections into integers:   // and convert the sections into integers:
/home/resonancg/www/wiki/data/pages/logiciels/serial-processing/accueil.txt · Dernière modification: 2018/01/22 11:19 de resonance