Modifications

Sauter à la navigation Sauter à la recherche
Ligne 60 : Ligne 60 :  
NEO_GRB + NEO_KHZ800);</nowiki>
 
NEO_GRB + NEO_KHZ800);</nowiki>
   −
The first two arguments — 5 and 8 — are the width and height of the matrix, in pixels. The third argument — 6 — is the pin number to which the NeoPixels are connected. On the shield this is hard-wired to digital pin 6, but standalone matrices are free to use other pins.
+
'''Les deux premiers arguments''' — 5 et 8 — représentent la largeur (''width'') et hauteur (''height'') de la matrice, en pixelsin pixels.  
   −
The next argument is the interesting one. This indicates where the first pixel in the matrix is positioned and the arrangement of rows or columns. The first pixel {{underline|must}} be at one of the four corners; which corner is indicated by adding either NEO_MATRIX_TOP or NEO_MATRIX_BOTTOM to either NEO_MATRIX_LEFT or NEO_MATRIX_RIGHT. The row/column arrangement is indicated by further adding either NEO_MATRIX_COLUMNS or NEO_MATRIX_ROWS to either NEO_MATRIX_PROGRESSIVE or NEO_MATRIX_ZIGZAG. These values are all added to form a single value as in the above code.
+
'''Le troisième argument''' — 6 — est le numéro de broche (de donnée) sur laquelle les NéoPixels sont connéctés. Sur le shield, il s'agit de la broche digital 6 mais les autres matrices peuvent être utilisées avec n'importe quelle broche.
 +
 
 +
'''Le quatrième argument''' est le plus intéressant. Il indique où est positionné le premier Pixel sur la matrice et l'organisation en ligne ou en colonne. Le premier pixel {{underline|doit impérativement}} se trouver dans l'un des quatres coins; coin qui peut être identifié à l'aide des constantes NEO_MATRIX_TOP (en haut) ou NEO_MATRIX_BOTTOM (en bas) à laquel il faut ajouter NEO_MATRIX_LEFT (à gauche) ou NEO_MATRIX_RIGHT (à droite). La disposition en ligne (''row'') et colonne (''column'' ) est indiqué à l'aide de la contante NEO_MATRIX_COLUMNS (en colonne, vertical) ou NEO_MATRIX_ROWS (en ligne, horizontal). Pour finir, il faut indiquer comment les pixels s'enchainent à avec NEO_MATRIX_PROGRESSIVE (arrangement progressif, tous les pixels dans la même direction) ou NEO_MATRIX_ZIGZAG (inversion de sens à chaque ligne). Ces constantes sont additionnées en une seule valeur... dans la cas de notre shield, nous obtenons:
    
  NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE
 
  NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE
   −
The last argument is exactly the same as with the NeoPixel library, indicating the type of LED pixels being used. In the majority of cases with the latest NeoPixel products, you can simply leave this argument off…the example code is just being extra descriptive.  
+
'''Le dernier argument''' est identique à celui utilisé avec la librairie NéoPixel... il indique le type de NéoPixel utilisé dans le montage. Dans la plupart des cas, avec les deniers produits NéoPixels, vous pouvez laisser cet argument vide... cet exemple de code inclus le paramètre pour être le plus complet possible.  
    
'''The point of this setup is that the rest of the sketch never needs to think about the layout of the matrix. Coordinate (0,0) for drawing graphics will always be at the top-left, regardless of the actual position of the first NeoPixel.'''
 
'''The point of this setup is that the rest of the sketch never needs to think about the layout of the matrix. Coordinate (0,0) for drawing graphics will always be at the top-left, regardless of the actual position of the first NeoPixel.'''
29 917

modifications

Menu de navigation