Outils pour utilisateurs

Outils du site


start:arduino:max7219

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édentesRévision précédente
Prochaine révision
Révision précédente
start:arduino:max7219 [2025/07/24 16:18] – [Préparation Logiciels] adminstart:arduino:max7219 [2025/07/24 16:21] (Version actuelle) – [Pour la création de codes pour matrices de LEDS] admin
Ligne 40: Ligne 40:
 Le diagramme de synchronisation pour Max7219 et son format de données série sont joints ci-dessous avec ses caractéristiques électroniques. Le diagramme de synchronisation pour Max7219 et son format de données série sont joints ci-dessous avec ses caractéristiques électroniques.
  
-{{:start:arduino:400px-software1.jpg?800|}}+{{:start:arduino:400px-software1.jpg?600|}}
  
-{{:start:arduino:400px-software2.jpg?800|}}+{{:start:arduino:400px-software2.jpg?600|}}
  
 == Un programme de test sans librairie à inclure == == Un programme de test sans librairie à inclure ==
Ligne 201: Ligne 201:
        * {{ :start:arduino:adafruit-gfx-library-master.zip |Librairie Adafruit_gfx}}        * {{ :start:arduino:adafruit-gfx-library-master.zip |Librairie Adafruit_gfx}}
        * {{ :start:arduino:arduino-max72xxpanel-master.zip |Librairie Max72xx}}        * {{ :start:arduino:arduino-max72xxpanel-master.zip |Librairie Max72xx}}
 +
 +<code c exemple_002_code_max7219_32X8.ino>
 +include SPI.h
 +#include Adafruit_GFX.h
 +#include Max72xxPanel.h
 +
 +int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino•cc/en/Reference/SPI )
 +int numberOfHorizontalDisplays = 1;
 +int numberOfVerticalDisplays = 4;
 +
 +Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
 +
 +String tape = "Ayo belajar Arduino bersama DA Electronics";
 +int wait = 50; // In milliseconds
 +
 +int spacer = 1;
 +int width = 5 + spacer; // The font width is 5 pixels
 +
 +void setup() {
 +
 +matrix.setIntensity(7); // Use a value between 0 and 15 for brightness
 +
 +// Adjust to your own needs
 +matrix.setRotation(matrix.getRotation() + 1 ); // The first display is position upside down
 +// matrix.setRotation(1, 1); // The first display is position upside down
 +}
 +
 +void loop() {
 +
 +for ( int i = 0 ; i < width * tape.length() + matrix.width() - 1 - spacer; i++ ) {
 +
 +matrix.fillScreen(LOW);
 +
 +int letter = i / width;
 +int x = (matrix.width() - 1) - i % width;
 +int y = (matrix.height() - 8) / 2; // center the text vertically
 +
 +while ( x + width - spacer >= 0 && letter >= 0 ) {
 +if ( letter < tape.length() ) {
 +matrix.drawChar(x, y, tape[letter], HIGH, LOW, 1);
 +}
 +
 +letter--;
 +x -= width;
 +}
 +
 +matrix.write(); // Send bitmap to display
 +
 +delay(wait);
 +}
 +
 +</code>
  
  
  
/home/chanteri/www/fablab37110/data/attic/start/arduino/max7219.1753366737.txt.gz · Dernière modification : de admin