start:arduino:max7219
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 | ||
| start:arduino:max7219 [2021/03/18 17:10] – modification externe 127.0.0.1 | start: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. | ||
| - | {{: | + | {{: |
| - | {{: | + | {{: |
| == Un programme de test sans librairie à inclure == | == Un programme de test sans librairie à inclure == | ||
| Ligne 177: | Ligne 177: | ||
| * {{ : | * {{ : | ||
| * On peut y voir une demo en image animée... | * On peut y voir une demo en image animée... | ||
| - | *{{: | + | |
| === Pour la création de codes pour matrices de LEDS === | === Pour la création de codes pour matrices de LEDS === | ||
| Ligne 201: | Ligne 201: | ||
| * {{ : | * {{ : | ||
| * {{ : | * {{ : | ||
| + | |||
| + | <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:// | ||
| + | int numberOfHorizontalDisplays = 1; | ||
| + | int numberOfVerticalDisplays = 4; | ||
| + | |||
| + | Max72xxPanel matrix = Max72xxPanel(pinCS, | ||
| + | |||
| + | 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); | ||
| + | |||
| + | // Adjust to your own needs | ||
| + | matrix.setRotation(matrix.getRotation() + 1 ); // The first display is position upside down | ||
| + | // matrix.setRotation(1, | ||
| + | } | ||
| + | |||
| + | 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, | ||
| + | } | ||
| + | |||
| + | letter--; | ||
| + | x -= width; | ||
| + | } | ||
| + | |||
| + | matrix.write(); | ||
| + | |||
| + | delay(wait); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
/home/chanteri/www/fablab37110/data/attic/start/arduino/max7219.1616083818.txt.gz · Dernière modification : (modification externe)
