Sketch pour matrix 24x25 (sens de lecture du code)

Bonjour,

Mon projet : créer une matrix animée pour mon camion.
Elle est composée de 25 leds de largeur x 24 leds de hauteur soit 600 leds.
Les bandes de leds sont branchées en serpentins.

Après pas mal de recherche, j'ai trouvé un code qui correspondait à mes besoins.
Source : Brainy-bits
Ce code utilise simplement la lecture de couleur point par point en serpentin d'après ce que j'ai compris.
Avec un delay, on peut facilement créer des animations.

Afin de créer une animation, je fais un pixel art de 25x24 pixels.
J'utilise un code html qui me permet d'obtenir chaque couleur pixel par pixel dans l'ordre désiré.
Je copie donc ce code (en copie ci-dessous).

Le soucis, c'est que mon code html m'indique les couleurs point par point, ligne après ligne dans l'ordre qui devrait être affiché.
Le code de Brainy-bits lit mon sketch mais il inverse les lignes impaires. Je pense qu'il y a un soucis avec l'information de serpentin.
J'ai essayé avec cette commande const bool kMatrixSerpentineLayout = true; mais le résultat est pire. J'imagine que ma commande n'est pas correct.

J'ai essayé d'être assez précis, j'espère que vous pourrez m'aiguiller.
Merci par avance
Patrice

/* Arduino 256 RGB LEDs Matrix Animation Frame 
 * Using WS2812 LED Strips
 
Created by Yvan / https://Brainy-Bits.com

This code is in the public domain...

You can: copy it, use it, modify it, share it or just plain ignore it!
Thx!

*/

#include <avr/pgmspace.h>  // Needed to store stuff in Flash using PROGMEM
#include "FastLED.h"       // Fastled library to control the LEDs

// How many leds are connected?
#define NUM_LEDS 600

// Define the Data Pin
#define DATA_PIN 3  // Connected to the data pin of the first LED strip

// Define the array of leds
CRGB leds[NUM_LEDS];

// Sens matrix
//const bool    kMatrixSerpentineLayout = true;

// Create the array of retro arcade characters and store it in Flash memory
const long ano01[] PROGMEM =
{
0xFFFFFD,0xFEFFFF,0xFAFFFF,0xFBFFFF,0xFEFFFD,0xFFFFFD,0xFAFEFF,0xFEFFFF,0xFFFFFD,0xFFFDFD,0xFFFDFF,0xFFFBFF,0xFFFDFF,0xFFFDFF,0xFFFFFD,0xFFFFFA,0xFDFFF7,0xFDFFFA,0xFEFFFF,0xFCFCFE,0xFFFFFB,0xFFFEFB,0xFFFDFE,0xFFFDFF,0xFFFEFF,
0xFFFDF8,0x030000,0x000205,0x000107,0x010007,0x060005,0x030000,0x030000,0x010000,0x000000,0x000400,0x000300,0x000200,0x010000,0x010000,0x000002,0x010206,0x010204,0x010000,0x010101,0x000505,0x000305,0x000108,0x010008,0xFFFDFF,
0xFDFFFE,0x010101,0xFEFEFC,0xFFFFFB,0xFFFFFA,0xFFFFFA,0xFFFFFA,0xFEFDFB,0xFCFFFF,0xFBFFFF,0xFBFFFF,0xFFFEFF,0xFFFCFF,0xFFFCFF,0xFEFFFF,0xFCFFFF,0xFEFCFF,0xFFFEFF,0xFEFFFD,0xFEFFFD,0xF9FCF5,0xFFFFFB,0xFFFFFB,0x010000,0xFFFEFD,
0xFCFFFF,0x100000,0xFFE8EB,0xCE5658,0xEF484F,0xFD424D,0xFF4757,0xFE4555,0xFF434D,0xFF434B,0xFF434B,0xFF424D,0xFF444A,0xFF444A,0xFF444B,0xFF444B,0xFF4850,0xFA404B,0xFF4252,0xFF4253,0xFF464D,0xDF5354,0xFFF1EB,0x000100,0xFFFEFF,
0xFFFDFF,0x120000,0xFFEAEF,0xAE6C70,0xFFF8F6,0xFFFFFD,0xFBFFFE,0xFAFEFF,0xFFFEFF,0xFFFEFF,0xFEFFFB,0xFEFFFA,0xFCFFFB,0xFEFFFF,0xFFFEFF,0xFFFEFF,0xFFFFFF,0xFFFFFF,0xFFFDFE,0xFFF0F3,0xFFEBEC,0xAC6B69,0xFFF9F1,0x010200,0xFCFFFD,
0xFCFEFB,0x0F0000,0xFFE9ED,0xA46182,0xFEF1FF,0x162BBA,0x0022E6,0x0127FF,0x0325FF,0x0325FF,0x0226FF,0x0027FF,0x0226FE,0x0226FE,0x0326FE,0x0226FF,0x0027FC,0x002AFE,0x002AFF,0x1C25C8,0xFFE5FF,0xAA6367,0xFFF9FA,0x000104,0xFFFEFF,
0xFFFBFF,0x150000,0xFFE8F1,0xA76684,0xF8F6FF,0x192D72,0xF9FFFF,0xFFFEF9,0xFEFFFF,0xFEFFFF,0xFEFFFB,0xFFFFFB,0xFEFFFD,0xFFFFFF,0xFFFEFF,0xFFFDFF,0xFFFEFF,0xF6F8FF,0xEAF7FF,0x332676,0xFFE4FF,0xB5666C,0xFFF6FA,0x030104,0xFFFDFF,
0xFFFFFD,0x0F0000,0xFFECE7,0xA36B84,0xF7F2FF,0x123974,0xCEFFE6,0x5CDB56,0x38F340,0x27FE34,0x2CFD30,0x2CFE2D,0x27FF2B,0x27FF29,0x29FF2B,0x2AFF2B,0x2CFF27,0x44E865,0xC8FFFF,0x2C267E,0xFFE8FF,0xAF6564,0xFFF6F8,0x000100,0xFFFFFA,
0xFFFFFD,0x120000,0xFFE8EF,0xAC6587,0xFAF2FF,0x103B70,0xC7FFE6,0x77C975,0xF1FFEF,0xFFFEFF,0xFEFEFF,0xFEFEFF,0xFFFEFF,0xFFFEFF,0xFFFFF8,0xEFFFE7,0xD1FFCD,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFFFFFA,0x110000,0xFFE7F1,0xAB658A,0xF8F3FF,0x103B70,0xCAFFE8,0x80C95D,0xFFFF9F,0xE8D147,0xFCDA20,0xFFD605,0xFFD703,0xFFD605,0xFED605,0xE3E12C,0xDDFF9F,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFCFFFF,0x0E0000,0xFFEAEC,0xAB6683,0xFEF0FF,0x153870,0xCAFFE8,0x7CCC5D,0xFBFFA3,0xD8D683,0xFFFFE6,0xF9FDFC,0xFBFFFC,0xFFFFE4,0xFFFFB3,0xCDDA70,0xD6FFB8,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFFFFFD,0x110000,0xFFE9EF,0xA86789,0xFDF1FF,0x123972,0xCAFFE4,0x80CA5B,0xFFFFA5,0xF2C196,0xFFDAFF,0xBC26C5,0xE40CEB,0xD717BC,0xFFEAD8,0xCFDB6F,0xD8FFB6,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFFFFFD,0x110000,0xFFE9EF,0xA86789,0xFDF1FF,0x123972,0xCAFFE4,0x80CA5B,0xFFFFA5,0xF2C196,0xFFDAFF,0xBC26C5,0xE40CEB,0xD717BC,0xFFEAD8,0xCFDB6F,0xD8FFB6,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFCFFFF,0x0E0000,0xFFEAEC,0xAB6683,0xFEF0FF,0x153870,0xCAFFE8,0x7CCC5D,0xFBFFA3,0xD8D683,0xFFFFE6,0xF9FDFC,0xFBFFFC,0xFFFFE4,0xFFFFB3,0xCDDA70,0xD6FFB8,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFFFFFA,0x110000,0xFFE7F1,0xAB658A,0xF8F3FF,0x103B70,0xCAFFE8,0x80C95D,0xFFFF9F,0xE8D147,0xFCDA20,0xFFD605,0xFFD703,0xFFD605,0xFED605,0xE3E12C,0xDDFF9F,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFFFFFD,0x120000,0xFFE8EF,0xAC6587,0xFAF2FF,0x103B70,0xC7FFE6,0x77C975,0xF1FFEF,0xFFFEFF,0xFEFEFF,0xFEFEFF,0xFFFEFF,0xFFFEFF,0xFFFFF8,0xEFFFE7,0xD1FFCD,0x72C591,0xDCFFFF,0x30277A,0xFFE8FF,0xAD686B,0xFFF8FA,0x000000,0xFFFFFF,
0xFFFFFD,0x0F0000,0xFFECE7,0xA26A83,0xF8F3FF,0x123974,0xCDFFE5,0x5DDC57,0x38F340,0x27FE34,0x2CFD30,0x2CFE2D,0x27FF2B,0x27FF29,0x29FF2B,0x2AFF2B,0x2CFF27,0x45E966,0xC8FFFF,0x2D277F,0xFFE8FF,0xAF6564,0xFFF6F8,0x000002,0xFFFFFA,
0xFFFBFF,0x170002,0xFFE8F1,0xA66583,0xF8F6FF,0x192D72,0xF9FFFF,0xFFFFFA,0xFEFFFF,0xFEFFFF,0xFEFFFB,0xFFFFFB,0xFEFFFD,0xFFFFFF,0xFFFEFF,0xFFFDFF,0xFFFDFF,0xF7F8FF,0xEBF8FF,0x342777,0xFFE4FF,0xB5666C,0xFFF6FA,0x030104,0xFFFDFF,
0xFCFEFB,0x0F0000,0xFFE9ED,0xA36081,0xFEF1FF,0x162BBA,0x0021E5,0x0127FF,0x0325FF,0x0325FF,0x0226FF,0x0027FF,0x0226FE,0x0226FE,0x0326FE,0x0226FF,0x0026FB,0x002AFE,0x002AFF,0x1D26C9,0xFFE5FF,0xAA6367,0xFFF9FA,0x000104,0xFFFEFF,
0xFFFDFF,0x120000,0xFFEAEF,0xAE6C70,0xFFF8F6,0xFFFFFD,0xFBFFFE,0xFAFEFF,0xFFFEFF,0xFFFEFF,0xFEFFFB,0xFEFFFA,0xFCFFFB,0xFEFFFF,0xFFFEFF,0xFFFEFF,0xFFFFFF,0xFFFFFF,0xFFFDFE,0xFFF1F4,0xFFEBEC,0xAC6B69,0xFFF9F3,0x010200,0xFCFFFD,
0xFCFFFF,0x100000,0xFFE8EB,0xCE5658,0xEF484F,0xFD424D,0xFF4757,0xFE4555,0xFF434D,0xFF434B,0xFF434B,0xFF424D,0xFF444A,0xFF444A,0xFF444B,0xFF444B,0xFF4850,0xFA404B,0xFF4252,0xFF4253,0xFF464D,0xDF5354,0xFFF1EB,0x000100,0xFFFEFF,
0xFEFFFF,0x000000,0xFEFEFC,0xFFFFFB,0xFFFFFA,0xFFFFFA,0xFFFFFA,0xFDFCFA,0xFCFFFF,0xFBFFFF,0xFBFFFF,0xFFFEFF,0xFFFCFF,0xFFFCFF,0xFEFFFF,0xFCFFFF,0xFEFCFF,0xFFFEFF,0xFEFFFD,0xFEFFFD,0xF9FCF5,0xFFFFFB,0xFFFFFB,0x010000,0xFFFEFD,
0xFFFDF8,0x030000,0x000205,0x000107,0x010007,0x060005,0x040001,0x030000,0x010000,0x000000,0x000400,0x000300,0x000200,0x010000,0x010000,0x000002,0x020307,0x010204,0x010000,0x010101,0x000606,0x000305,0x000106,0x010006,0xFFFDFF,
0xFFFFFD,0xFDFFFE,0xFBFFFF,0xFBFFFF,0xFDFFFC,0xFFFFFD,0xFBFFFF,0xFEFFFF,0xFFFFFD,0xFFFDFD,0xFFFDFF,0xFFFBFF,0xFFFDFF,0xFFFDFF,0xFFFFFD,0xFFFFFA,0xFEFFF6,0xFDFFF9,0xFEFFFD,0xFCFCFC,0xFFFFFA,0xFFFFFA,0xFFFDFE,0xFFFDFF,0xFFFEFF
};





void setup() { 
FastLED.addLeds<NEOPIXEL,DATA_PIN>(leds, NUM_LEDS);  // Init of the Fastled library
FastLED.setBrightness(20);
}

void loop() { 


// Put ano first frame
for(int passtime = 0; passtime < 8; passtime++) { // Display it 8 times

FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = pgm_read_dword(&(ano01[i]));  // Read array from Flash
  }

FastLED.show();
delay(5000);

}
}

sur quel Arduino ?

faudrait aussi expliquer comment la matrice est câblée. Si c'est comme sur le site web, les pixels vont une fois dans un sens, une fois dans l'autre

il faut en tenir compte dans l'ordre des couleurs dans le tableau ano01

Bonjour J-M-L

L'arduino est un mega.

J'ai manqué de clarté mais effectivement, en mentionnant "serpentin" au début, je parlais bien de cette manière de branchement qui correspond à votre schéma.

Du coup, mon tableau de couleur étant fastidieux à modifier, il serait plus simple de modifier le branchement type "serpentin" et de refaire des retours à la ligne ?

C'est quand même curieux, le tableau est lu dans l'ordre (avec retour à la ligne) alors qu'une option existe pour ce fameux serpentin. Je ne désespère pas.

Merci pour votre aide.
Patrice

Je parle de cette option dans mon premier post "kMatrixSerpentineLayout" mais peut-être n'est elle pas applicable pour un tableau.

Je ne vois pas où c’est utilisé dans le code

Ça fait parti des commandes de la bibliothèque fastled.

Je pensais que certaine commande pouvais être ajoutée à un code.

Je suis totalement novice.
Donc je teste et je me renseigne. :sweat_smile:

Merci encore pour votre intérêt.

Non pas de cette façon, peut être en modifiant la bibliothèque

Du coup, ça devient plus compliqué pour moi :upside_down_face:

Si vous avez des pistes plus précises, je suis bien sur preneur.

Merci encore
Patrice

le plus simple c'est d'inverser l'ordre des couleurs toutes les 2 lignes dans le tableau

vous pouvez faire bosser votre arduino pour le générer plutôt que de vous ennuyer à le faire à la main:

const uint32_t ano01[] PROGMEM =
{
  0xFFFFFD, 0xFEFFFF, 0xFAFFFF, 0xFBFFFF, 0xFEFFFD, 0xFFFFFD, 0xFAFEFF, 0xFEFFFF, 0xFFFFFD, 0xFFFDFD, 0xFFFDFF, 0xFFFBFF, 0xFFFDFF, 0xFFFDFF, 0xFFFFFD, 0xFFFFFA, 0xFDFFF7, 0xFDFFFA, 0xFEFFFF, 0xFCFCFE, 0xFFFFFB, 0xFFFEFB, 0xFFFDFE, 0xFFFDFF, 0xFFFEFF,
  0xFFFDF8, 0x030000, 0x000205, 0x000107, 0x010007, 0x060005, 0x030000, 0x030000, 0x010000, 0x000000, 0x000400, 0x000300, 0x000200, 0x010000, 0x010000, 0x000002, 0x010206, 0x010204, 0x010000, 0x010101, 0x000505, 0x000305, 0x000108, 0x010008, 0xFFFDFF,
  0xFDFFFE, 0x010101, 0xFEFEFC, 0xFFFFFB, 0xFFFFFA, 0xFFFFFA, 0xFFFFFA, 0xFEFDFB, 0xFCFFFF, 0xFBFFFF, 0xFBFFFF, 0xFFFEFF, 0xFFFCFF, 0xFFFCFF, 0xFEFFFF, 0xFCFFFF, 0xFEFCFF, 0xFFFEFF, 0xFEFFFD, 0xFEFFFD, 0xF9FCF5, 0xFFFFFB, 0xFFFFFB, 0x010000, 0xFFFEFD,
  0xFCFFFF, 0x100000, 0xFFE8EB, 0xCE5658, 0xEF484F, 0xFD424D, 0xFF4757, 0xFE4555, 0xFF434D, 0xFF434B, 0xFF434B, 0xFF424D, 0xFF444A, 0xFF444A, 0xFF444B, 0xFF444B, 0xFF4850, 0xFA404B, 0xFF4252, 0xFF4253, 0xFF464D, 0xDF5354, 0xFFF1EB, 0x000100, 0xFFFEFF,
  0xFFFDFF, 0x120000, 0xFFEAEF, 0xAE6C70, 0xFFF8F6, 0xFFFFFD, 0xFBFFFE, 0xFAFEFF, 0xFFFEFF, 0xFFFEFF, 0xFEFFFB, 0xFEFFFA, 0xFCFFFB, 0xFEFFFF, 0xFFFEFF, 0xFFFEFF, 0xFFFFFF, 0xFFFFFF, 0xFFFDFE, 0xFFF0F3, 0xFFEBEC, 0xAC6B69, 0xFFF9F1, 0x010200, 0xFCFFFD,
  0xFCFEFB, 0x0F0000, 0xFFE9ED, 0xA46182, 0xFEF1FF, 0x162BBA, 0x0022E6, 0x0127FF, 0x0325FF, 0x0325FF, 0x0226FF, 0x0027FF, 0x0226FE, 0x0226FE, 0x0326FE, 0x0226FF, 0x0027FC, 0x002AFE, 0x002AFF, 0x1C25C8, 0xFFE5FF, 0xAA6367, 0xFFF9FA, 0x000104, 0xFFFEFF,
  0xFFFBFF, 0x150000, 0xFFE8F1, 0xA76684, 0xF8F6FF, 0x192D72, 0xF9FFFF, 0xFFFEF9, 0xFEFFFF, 0xFEFFFF, 0xFEFFFB, 0xFFFFFB, 0xFEFFFD, 0xFFFFFF, 0xFFFEFF, 0xFFFDFF, 0xFFFEFF, 0xF6F8FF, 0xEAF7FF, 0x332676, 0xFFE4FF, 0xB5666C, 0xFFF6FA, 0x030104, 0xFFFDFF,
  0xFFFFFD, 0x0F0000, 0xFFECE7, 0xA36B84, 0xF7F2FF, 0x123974, 0xCEFFE6, 0x5CDB56, 0x38F340, 0x27FE34, 0x2CFD30, 0x2CFE2D, 0x27FF2B, 0x27FF29, 0x29FF2B, 0x2AFF2B, 0x2CFF27, 0x44E865, 0xC8FFFF, 0x2C267E, 0xFFE8FF, 0xAF6564, 0xFFF6F8, 0x000100, 0xFFFFFA,
  0xFFFFFD, 0x120000, 0xFFE8EF, 0xAC6587, 0xFAF2FF, 0x103B70, 0xC7FFE6, 0x77C975, 0xF1FFEF, 0xFFFEFF, 0xFEFEFF, 0xFEFEFF, 0xFFFEFF, 0xFFFEFF, 0xFFFFF8, 0xEFFFE7, 0xD1FFCD, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFFFFFA, 0x110000, 0xFFE7F1, 0xAB658A, 0xF8F3FF, 0x103B70, 0xCAFFE8, 0x80C95D, 0xFFFF9F, 0xE8D147, 0xFCDA20, 0xFFD605, 0xFFD703, 0xFFD605, 0xFED605, 0xE3E12C, 0xDDFF9F, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFCFFFF, 0x0E0000, 0xFFEAEC, 0xAB6683, 0xFEF0FF, 0x153870, 0xCAFFE8, 0x7CCC5D, 0xFBFFA3, 0xD8D683, 0xFFFFE6, 0xF9FDFC, 0xFBFFFC, 0xFFFFE4, 0xFFFFB3, 0xCDDA70, 0xD6FFB8, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFFFFFD, 0x110000, 0xFFE9EF, 0xA86789, 0xFDF1FF, 0x123972, 0xCAFFE4, 0x80CA5B, 0xFFFFA5, 0xF2C196, 0xFFDAFF, 0xBC26C5, 0xE40CEB, 0xD717BC, 0xFFEAD8, 0xCFDB6F, 0xD8FFB6, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFFFFFD, 0x110000, 0xFFE9EF, 0xA86789, 0xFDF1FF, 0x123972, 0xCAFFE4, 0x80CA5B, 0xFFFFA5, 0xF2C196, 0xFFDAFF, 0xBC26C5, 0xE40CEB, 0xD717BC, 0xFFEAD8, 0xCFDB6F, 0xD8FFB6, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFCFFFF, 0x0E0000, 0xFFEAEC, 0xAB6683, 0xFEF0FF, 0x153870, 0xCAFFE8, 0x7CCC5D, 0xFBFFA3, 0xD8D683, 0xFFFFE6, 0xF9FDFC, 0xFBFFFC, 0xFFFFE4, 0xFFFFB3, 0xCDDA70, 0xD6FFB8, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFFFFFA, 0x110000, 0xFFE7F1, 0xAB658A, 0xF8F3FF, 0x103B70, 0xCAFFE8, 0x80C95D, 0xFFFF9F, 0xE8D147, 0xFCDA20, 0xFFD605, 0xFFD703, 0xFFD605, 0xFED605, 0xE3E12C, 0xDDFF9F, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFFFFFD, 0x120000, 0xFFE8EF, 0xAC6587, 0xFAF2FF, 0x103B70, 0xC7FFE6, 0x77C975, 0xF1FFEF, 0xFFFEFF, 0xFEFEFF, 0xFEFEFF, 0xFFFEFF, 0xFFFEFF, 0xFFFFF8, 0xEFFFE7, 0xD1FFCD, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF,
  0xFFFFFD, 0x0F0000, 0xFFECE7, 0xA26A83, 0xF8F3FF, 0x123974, 0xCDFFE5, 0x5DDC57, 0x38F340, 0x27FE34, 0x2CFD30, 0x2CFE2D, 0x27FF2B, 0x27FF29, 0x29FF2B, 0x2AFF2B, 0x2CFF27, 0x45E966, 0xC8FFFF, 0x2D277F, 0xFFE8FF, 0xAF6564, 0xFFF6F8, 0x000002, 0xFFFFFA,
  0xFFFBFF, 0x170002, 0xFFE8F1, 0xA66583, 0xF8F6FF, 0x192D72, 0xF9FFFF, 0xFFFFFA, 0xFEFFFF, 0xFEFFFF, 0xFEFFFB, 0xFFFFFB, 0xFEFFFD, 0xFFFFFF, 0xFFFEFF, 0xFFFDFF, 0xFFFDFF, 0xF7F8FF, 0xEBF8FF, 0x342777, 0xFFE4FF, 0xB5666C, 0xFFF6FA, 0x030104, 0xFFFDFF,
  0xFCFEFB, 0x0F0000, 0xFFE9ED, 0xA36081, 0xFEF1FF, 0x162BBA, 0x0021E5, 0x0127FF, 0x0325FF, 0x0325FF, 0x0226FF, 0x0027FF, 0x0226FE, 0x0226FE, 0x0326FE, 0x0226FF, 0x0026FB, 0x002AFE, 0x002AFF, 0x1D26C9, 0xFFE5FF, 0xAA6367, 0xFFF9FA, 0x000104, 0xFFFEFF,
  0xFFFDFF, 0x120000, 0xFFEAEF, 0xAE6C70, 0xFFF8F6, 0xFFFFFD, 0xFBFFFE, 0xFAFEFF, 0xFFFEFF, 0xFFFEFF, 0xFEFFFB, 0xFEFFFA, 0xFCFFFB, 0xFEFFFF, 0xFFFEFF, 0xFFFEFF, 0xFFFFFF, 0xFFFFFF, 0xFFFDFE, 0xFFF1F4, 0xFFEBEC, 0xAC6B69, 0xFFF9F3, 0x010200, 0xFCFFFD,
  0xFCFFFF, 0x100000, 0xFFE8EB, 0xCE5658, 0xEF484F, 0xFD424D, 0xFF4757, 0xFE4555, 0xFF434D, 0xFF434B, 0xFF434B, 0xFF424D, 0xFF444A, 0xFF444A, 0xFF444B, 0xFF444B, 0xFF4850, 0xFA404B, 0xFF4252, 0xFF4253, 0xFF464D, 0xDF5354, 0xFFF1EB, 0x000100, 0xFFFEFF,
  0xFEFFFF, 0x000000, 0xFEFEFC, 0xFFFFFB, 0xFFFFFA, 0xFFFFFA, 0xFFFFFA, 0xFDFCFA, 0xFCFFFF, 0xFBFFFF, 0xFBFFFF, 0xFFFEFF, 0xFFFCFF, 0xFFFCFF, 0xFEFFFF, 0xFCFFFF, 0xFEFCFF, 0xFFFEFF, 0xFEFFFD, 0xFEFFFD, 0xF9FCF5, 0xFFFFFB, 0xFFFFFB, 0x010000, 0xFFFEFD,
  0xFFFDF8, 0x030000, 0x000205, 0x000107, 0x010007, 0x060005, 0x040001, 0x030000, 0x010000, 0x000000, 0x000400, 0x000300, 0x000200, 0x010000, 0x010000, 0x000002, 0x020307, 0x010204, 0x010000, 0x010101, 0x000606, 0x000305, 0x000106, 0x010006, 0xFFFDFF,
  0xFFFFFD, 0xFDFFFE, 0xFBFFFF, 0xFBFFFF, 0xFDFFFC, 0xFFFFFD, 0xFBFFFF, 0xFEFFFF, 0xFFFFFD, 0xFFFDFD, 0xFFFDFF, 0xFFFBFF, 0xFFFDFF, 0xFFFDFF, 0xFFFFFD, 0xFFFFFA, 0xFEFFF6, 0xFDFFF9, 0xFEFFFD, 0xFCFCFC, 0xFFFFFA, 0xFFFFFA, 0xFFFDFE, 0xFFFDFF, 0xFFFEFF
};


void print3Bytes(uint32_t v)
{
  if (v < 0x0FFFFF) Serial.write('0');
  if (v < 0x0FFFF) Serial.write('0');
  if (v < 0x0FFF) Serial.write('0');
  if (v < 0x0FF) Serial.write('0');
  if (v < 0x0F) Serial.write('0');
  Serial.print(v & 0xFFFFFF, HEX);
}

void setup() {
  Serial.begin(115200);
  Serial.println(F("// tableau inversé une ligne sur 2"));
  Serial.println(F("const uint32_t ano01[] PROGMEM =\n{"));
  for (byte l = 0; l < 24; l++) {
    Serial.print(F("  "));
    for (byte c = 0; c < 25; c++) {
      Serial.print(F("0x"));
      if (l & 1) {
        // toutes les lignes impaires on inverse
        print3Bytes(pgm_read_dword(&(ano01[25 * l + (24 - c)])));
      } else {
        print3Bytes(pgm_read_dword(&(ano01[25 * l + c])));
      }
      Serial.print(F(", "));
    }
    Serial.println();
  }
  Serial.print(F("};"));
}
void loop() {}

ça va vous afficher cela dans le moniteur série à 155200 bauds

// tableau inversé une ligne sur 2
const uint32_t ano01[] PROGMEM =
{
  0xFFFFFD, 0xFEFFFF, 0xFAFFFF, 0xFBFFFF, 0xFEFFFD, 0xFFFFFD, 0xFAFEFF, 0xFEFFFF, 0xFFFFFD, 0xFFFDFD, 0xFFFDFF, 0xFFFBFF, 0xFFFDFF, 0xFFFDFF, 0xFFFFFD, 0xFFFFFA, 0xFDFFF7, 0xFDFFFA, 0xFEFFFF, 0xFCFCFE, 0xFFFFFB, 0xFFFEFB, 0xFFFDFE, 0xFFFDFF, 0xFFFEFF, 
  0xFFFDFF, 0x010008, 0x000108, 0x000305, 0x000505, 0x010101, 0x010000, 0x010204, 0x010206, 0x000002, 0x010000, 0x010000, 0x000200, 0x000300, 0x000400, 0x000000, 0x010000, 0x030000, 0x030000, 0x060005, 0x010007, 0x000107, 0x000205, 0x030000, 0xFFFDF8, 
  0xFDFFFE, 0x010101, 0xFEFEFC, 0xFFFFFB, 0xFFFFFA, 0xFFFFFA, 0xFFFFFA, 0xFEFDFB, 0xFCFFFF, 0xFBFFFF, 0xFBFFFF, 0xFFFEFF, 0xFFFCFF, 0xFFFCFF, 0xFEFFFF, 0xFCFFFF, 0xFEFCFF, 0xFFFEFF, 0xFEFFFD, 0xFEFFFD, 0xF9FCF5, 0xFFFFFB, 0xFFFFFB, 0x010000, 0xFFFEFD, 
  0xFFFEFF, 0x000100, 0xFFF1EB, 0xDF5354, 0xFF464D, 0xFF4253, 0xFF4252, 0xFA404B, 0xFF4850, 0xFF444B, 0xFF444B, 0xFF444A, 0xFF444A, 0xFF424D, 0xFF434B, 0xFF434B, 0xFF434D, 0xFE4555, 0xFF4757, 0xFD424D, 0xEF484F, 0xCE5658, 0xFFE8EB, 0x100000, 0xFCFFFF, 
  0xFFFDFF, 0x120000, 0xFFEAEF, 0xAE6C70, 0xFFF8F6, 0xFFFFFD, 0xFBFFFE, 0xFAFEFF, 0xFFFEFF, 0xFFFEFF, 0xFEFFFB, 0xFEFFFA, 0xFCFFFB, 0xFEFFFF, 0xFFFEFF, 0xFFFEFF, 0xFFFFFF, 0xFFFFFF, 0xFFFDFE, 0xFFF0F3, 0xFFEBEC, 0xAC6B69, 0xFFF9F1, 0x010200, 0xFCFFFD, 
  0xFFFEFF, 0x000104, 0xFFF9FA, 0xAA6367, 0xFFE5FF, 0x1C25C8, 0x002AFF, 0x002AFE, 0x0027FC, 0x0226FF, 0x0326FE, 0x0226FE, 0x0226FE, 0x0027FF, 0x0226FF, 0x0325FF, 0x0325FF, 0x0127FF, 0x0022E6, 0x162BBA, 0xFEF1FF, 0xA46182, 0xFFE9ED, 0x0F0000, 0xFCFEFB, 
  0xFFFBFF, 0x150000, 0xFFE8F1, 0xA76684, 0xF8F6FF, 0x192D72, 0xF9FFFF, 0xFFFEF9, 0xFEFFFF, 0xFEFFFF, 0xFEFFFB, 0xFFFFFB, 0xFEFFFD, 0xFFFFFF, 0xFFFEFF, 0xFFFDFF, 0xFFFEFF, 0xF6F8FF, 0xEAF7FF, 0x332676, 0xFFE4FF, 0xB5666C, 0xFFF6FA, 0x030104, 0xFFFDFF, 
  0xFFFFFA, 0x000100, 0xFFF6F8, 0xAF6564, 0xFFE8FF, 0x2C267E, 0xC8FFFF, 0x44E865, 0x2CFF27, 0x2AFF2B, 0x29FF2B, 0x27FF29, 0x27FF2B, 0x2CFE2D, 0x2CFD30, 0x27FE34, 0x38F340, 0x5CDB56, 0xCEFFE6, 0x123974, 0xF7F2FF, 0xA36B84, 0xFFECE7, 0x0F0000, 0xFFFFFD, 
  0xFFFFFD, 0x120000, 0xFFE8EF, 0xAC6587, 0xFAF2FF, 0x103B70, 0xC7FFE6, 0x77C975, 0xF1FFEF, 0xFFFEFF, 0xFEFEFF, 0xFEFEFF, 0xFFFEFF, 0xFFFEFF, 0xFFFFF8, 0xEFFFE7, 0xD1FFCD, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF, 
  0xFFFFFF, 0x000000, 0xFFF8FA, 0xAD686B, 0xFFE8FF, 0x30277A, 0xDCFFFF, 0x72C591, 0xDDFF9F, 0xE3E12C, 0xFED605, 0xFFD605, 0xFFD703, 0xFFD605, 0xFCDA20, 0xE8D147, 0xFFFF9F, 0x80C95D, 0xCAFFE8, 0x103B70, 0xF8F3FF, 0xAB658A, 0xFFE7F1, 0x110000, 0xFFFFFA, 
  0xFCFFFF, 0x0E0000, 0xFFEAEC, 0xAB6683, 0xFEF0FF, 0x153870, 0xCAFFE8, 0x7CCC5D, 0xFBFFA3, 0xD8D683, 0xFFFFE6, 0xF9FDFC, 0xFBFFFC, 0xFFFFE4, 0xFFFFB3, 0xCDDA70, 0xD6FFB8, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF, 
  0xFFFFFF, 0x000000, 0xFFF8FA, 0xAD686B, 0xFFE8FF, 0x30277A, 0xDCFFFF, 0x72C591, 0xD8FFB6, 0xCFDB6F, 0xFFEAD8, 0xD717BC, 0xE40CEB, 0xBC26C5, 0xFFDAFF, 0xF2C196, 0xFFFFA5, 0x80CA5B, 0xCAFFE4, 0x123972, 0xFDF1FF, 0xA86789, 0xFFE9EF, 0x110000, 0xFFFFFD, 
  0xFFFFFD, 0x110000, 0xFFE9EF, 0xA86789, 0xFDF1FF, 0x123972, 0xCAFFE4, 0x80CA5B, 0xFFFFA5, 0xF2C196, 0xFFDAFF, 0xBC26C5, 0xE40CEB, 0xD717BC, 0xFFEAD8, 0xCFDB6F, 0xD8FFB6, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF, 
  0xFFFFFF, 0x000000, 0xFFF8FA, 0xAD686B, 0xFFE8FF, 0x30277A, 0xDCFFFF, 0x72C591, 0xD6FFB8, 0xCDDA70, 0xFFFFB3, 0xFFFFE4, 0xFBFFFC, 0xF9FDFC, 0xFFFFE6, 0xD8D683, 0xFBFFA3, 0x7CCC5D, 0xCAFFE8, 0x153870, 0xFEF0FF, 0xAB6683, 0xFFEAEC, 0x0E0000, 0xFCFFFF, 
  0xFFFFFA, 0x110000, 0xFFE7F1, 0xAB658A, 0xF8F3FF, 0x103B70, 0xCAFFE8, 0x80C95D, 0xFFFF9F, 0xE8D147, 0xFCDA20, 0xFFD605, 0xFFD703, 0xFFD605, 0xFED605, 0xE3E12C, 0xDDFF9F, 0x72C591, 0xDCFFFF, 0x30277A, 0xFFE8FF, 0xAD686B, 0xFFF8FA, 0x000000, 0xFFFFFF, 
  0xFFFFFF, 0x000000, 0xFFF8FA, 0xAD686B, 0xFFE8FF, 0x30277A, 0xDCFFFF, 0x72C591, 0xD1FFCD, 0xEFFFE7, 0xFFFFF8, 0xFFFEFF, 0xFFFEFF, 0xFEFEFF, 0xFEFEFF, 0xFFFEFF, 0xF1FFEF, 0x77C975, 0xC7FFE6, 0x103B70, 0xFAF2FF, 0xAC6587, 0xFFE8EF, 0x120000, 0xFFFFFD, 
  0xFFFFFD, 0x0F0000, 0xFFECE7, 0xA26A83, 0xF8F3FF, 0x123974, 0xCDFFE5, 0x5DDC57, 0x38F340, 0x27FE34, 0x2CFD30, 0x2CFE2D, 0x27FF2B, 0x27FF29, 0x29FF2B, 0x2AFF2B, 0x2CFF27, 0x45E966, 0xC8FFFF, 0x2D277F, 0xFFE8FF, 0xAF6564, 0xFFF6F8, 0x000002, 0xFFFFFA, 
  0xFFFDFF, 0x030104, 0xFFF6FA, 0xB5666C, 0xFFE4FF, 0x342777, 0xEBF8FF, 0xF7F8FF, 0xFFFDFF, 0xFFFDFF, 0xFFFEFF, 0xFFFFFF, 0xFEFFFD, 0xFFFFFB, 0xFEFFFB, 0xFEFFFF, 0xFEFFFF, 0xFFFFFA, 0xF9FFFF, 0x192D72, 0xF8F6FF, 0xA66583, 0xFFE8F1, 0x170002, 0xFFFBFF, 
  0xFCFEFB, 0x0F0000, 0xFFE9ED, 0xA36081, 0xFEF1FF, 0x162BBA, 0x0021E5, 0x0127FF, 0x0325FF, 0x0325FF, 0x0226FF, 0x0027FF, 0x0226FE, 0x0226FE, 0x0326FE, 0x0226FF, 0x0026FB, 0x002AFE, 0x002AFF, 0x1D26C9, 0xFFE5FF, 0xAA6367, 0xFFF9FA, 0x000104, 0xFFFEFF, 
  0xFCFFFD, 0x010200, 0xFFF9F3, 0xAC6B69, 0xFFEBEC, 0xFFF1F4, 0xFFFDFE, 0xFFFFFF, 0xFFFFFF, 0xFFFEFF, 0xFFFEFF, 0xFEFFFF, 0xFCFFFB, 0xFEFFFA, 0xFEFFFB, 0xFFFEFF, 0xFFFEFF, 0xFAFEFF, 0xFBFFFE, 0xFFFFFD, 0xFFF8F6, 0xAE6C70, 0xFFEAEF, 0x120000, 0xFFFDFF, 
  0xFCFFFF, 0x100000, 0xFFE8EB, 0xCE5658, 0xEF484F, 0xFD424D, 0xFF4757, 0xFE4555, 0xFF434D, 0xFF434B, 0xFF434B, 0xFF424D, 0xFF444A, 0xFF444A, 0xFF444B, 0xFF444B, 0xFF4850, 0xFA404B, 0xFF4252, 0xFF4253, 0xFF464D, 0xDF5354, 0xFFF1EB, 0x000100, 0xFFFEFF, 
  0xFFFEFD, 0x010000, 0xFFFFFB, 0xFFFFFB, 0xF9FCF5, 0xFEFFFD, 0xFEFFFD, 0xFFFEFF, 0xFEFCFF, 0xFCFFFF, 0xFEFFFF, 0xFFFCFF, 0xFFFCFF, 0xFFFEFF, 0xFBFFFF, 0xFBFFFF, 0xFCFFFF, 0xFDFCFA, 0xFFFFFA, 0xFFFFFA, 0xFFFFFA, 0xFFFFFB, 0xFEFEFC, 0x000000, 0xFEFFFF, 
  0xFFFDF8, 0x030000, 0x000205, 0x000107, 0x010007, 0x060005, 0x040001, 0x030000, 0x010000, 0x000000, 0x000400, 0x000300, 0x000200, 0x010000, 0x010000, 0x000002, 0x020307, 0x010204, 0x010000, 0x010101, 0x000606, 0x000305, 0x000106, 0x010006, 0xFFFDFF, 
  0xFFFEFF, 0xFFFDFF, 0xFFFDFE, 0xFFFFFA, 0xFFFFFA, 0xFCFCFC, 0xFEFFFD, 0xFDFFF9, 0xFEFFF6, 0xFFFFFA, 0xFFFFFD, 0xFFFDFF, 0xFFFDFF, 0xFFFBFF, 0xFFFDFF, 0xFFFDFD, 0xFFFFFD, 0xFEFFFF, 0xFBFFFF, 0xFFFFFD, 0xFDFFFC, 0xFBFFFF, 0xFBFFFF, 0xFDFFFE, 0xFFFFFD, 
};

reste plus qu'à faire un copier coller dans le code :slight_smile:

(c'est plus propre d'utiliser const uint32_t que const long)

1 Like

Merci beaucoup
Je teste ça ce soir si possible.
Bonne journée :grinning_face_with_smiling_eyes:

La librairie FastLED propose effectivement une solution où apparaît kMatrixSerpentineLayout. Il faut regarder l'exemple nommé SmartMatrix.ino. Ce n'est pas le define kMatrixSerpentineLayout qui change quelque chose en fait, il est juste utilisé dans une fonction XY(x, y) qui assure le retournement de l'axe x une ligne sur 2.

Bonjour fdufnews
Je comprends bien votre remarque. Merci

Bonjour
Encore merci pour ce bout de code qui va bien m'aider
et me faire gagner un temps considérable.

J'avais également vu un autre code qui utilisait un tableau excel.
Peut-être que ça m'évitera de faire cette conversion.

Je reste à l'affut de tout complément d'information ou d'idée concernant mon petit projet.
Une petite photo d'exemple... Il faut bien entendu prendre un peu de recul ou dézoomer car cette matrix sera perçu de loin.

Salutations
Patrice