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 [2017/03/03 16:06] – gerardadmin | start:arduino:max7219 [2025/07/24 16:21] (Version actuelle) – [Pour la création de codes pour matrices de LEDS] admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ==== Tutoriels MAX7219 avec matrice 8X8 ==== | ||
| + | |||
| + | |||
| + | {{: | ||
| + | |||
| + | === Liens web tuto MAX7219 === | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[start: | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | *[[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[http:// | ||
| + | * [[start: | ||
| + | |||
| + | * [[http:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | === Programmes === | ||
| + | |||
| + | == Préparation Logiciels == | ||
| + | |||
| + | {{: | ||
| + | |||
| + | 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 == | ||
| + | |||
| + | <code .cpp exemple_code_MAX7219.ino> | ||
| + | | ||
| + | | ||
| + | /*Port Definitions*/ | ||
| + | int Max7219_pinCLK = 10; | ||
| + | int Max7219_pinCS = 9; | ||
| + | int Max7219_pinDIN = 8; | ||
| + | |||
| + | unsigned char disp1[38][8]={ | ||
| + | {0x3C, | ||
| + | {0x10, | ||
| + | {0x7E, | ||
| + | {0x3E, | ||
| + | {0x8, | ||
| + | {0x3C, | ||
| + | {0x3C, | ||
| + | {0x3E, | ||
| + | {0x0, | ||
| + | {0x3E, | ||
| + | {0x8, | ||
| + | {0x3C, | ||
| + | {0x3C, | ||
| + | {0x7C, | ||
| + | {0x7C, | ||
| + | {0x7C, | ||
| + | {0x3C, | ||
| + | {0x44, | ||
| + | {0x7C, | ||
| + | {0x3C, | ||
| + | {0x0, | ||
| + | {0x40, | ||
| + | {0x81, | ||
| + | {0x0, | ||
| + | {0x3C, | ||
| + | {0x3C, | ||
| + | {0x1C, | ||
| + | {0x3C, | ||
| + | {0x0, | ||
| + | {0x0, | ||
| + | {0x42, | ||
| + | {0x42, | ||
| + | {0x0, | ||
| + | {0x0, | ||
| + | {0x41, | ||
| + | {0x0, | ||
| + | }; | ||
| + | |||
| + | |||
| + | |||
| + | void Write_Max7219_byte(unsigned char DATA) | ||
| + | { | ||
| + | unsigned char i; | ||
| + | digitalWrite(Max7219_pinCS, | ||
| + | for(i=8; | ||
| + | { | ||
| + | | ||
| + | | ||
| + | DATA = DATA<< | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | |||
| + | void Write_Max7219(unsigned char address, | ||
| + | { | ||
| + | digitalWrite(Max7219_pinCS, | ||
| + | Write_Max7219_byte(address); | ||
| + | Write_Max7219_byte(dat); | ||
| + | digitalWrite(Max7219_pinCS, | ||
| + | } | ||
| + | |||
| + | void Init_MAX7219(void) | ||
| + | { | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | void setup() | ||
| + | { | ||
| + | |||
| + | pinMode(Max7219_pinCLK, | ||
| + | pinMode(Max7219_pinCS, | ||
| + | pinMode(Max7219_pinDIN, | ||
| + | delay(50); | ||
| + | Init_MAX7219(); | ||
| + | } | ||
| + | |||
| + | |||
| + | void loop() | ||
| + | { | ||
| + | | ||
| + | { | ||
| + | | ||
| + | Write_Max7219(i, | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | == Programmes avec librairies à inclure == | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | == Librairies == | ||
| + | |||
| + | Différentes librairies à tester | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | *{{ : | ||
| + | |||
| + | Une librairie pour les matrices en cascade ( à essayer ...) | ||
| + | *{{ : | ||
| + | |||
| + | Une autre librairie mais pour le Raspberry ( A voir lors d'une autre soirée ...) | ||
| + | * {{ : | ||
| + | * On peut y voir une demo en image animée... | ||
| + | |||
| + | === Pour la création de codes pour matrices de LEDS === | ||
| + | |||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | Pour la création de caractères 8X8 sur la matrice de LEDs | ||
| + | |||
| + | | ||
| + | |||
| + | *Le programme qui va avec : | ||
| + | |||
| + | | ||
| + | |||
| + | Toujours envoyer par Fernand : un programme de test, ne pas oublier d' | ||
| + | |||
| + | [[https:// | ||
| + | | ||
| + | *{{ : | ||
| + | * {{ : | ||
| + | * {{ : | ||
| + | |||
| + | <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); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
