arduinos sharing clock?

Ey!

I am using 3 arduino mega to drive each a different led strip. After some time, it is easy to see that they are not working at the same pace. Is there a way to connect the 3 arduinos so they share the same clock or something like this?

thanks!

If you have pins available on each Mega, you can make one a master that sends a heartbeat to the others. It does not have to be high frequency; e.g every second a pulse of 10ms.

I’d try using one as a master with an output pin as a “sync pulse” to inputs of the other two. You can send that secondary special clock pulse only when you update the display.

That’s basically how serial/shift register displays work… You send the data and then you send a “latch” pulse to update the display(s).

…I haven’t studied those details on the datasheet but you could probably share a clock if make a separate clock circuit, but you probably can’t share a resonator or crystal. And in either case you’d have to make some modifications to the boards.

I am using 3 arduino mega to drive each a different led strip.

Why? Maybe there’s a better solution?

Why? Maybe there’s a better solution?

well, I am using a programm that makes an interpretation of a bmp file and sends the data to the led strip. this programm cannot read 3 different bmp files simultaneously, so I simply use 3 arduinos, each with a different bmp file, but the have to be consistent in tempo, working at the same pace, and they are not.

If you have pins available on each Mega, you can make one a master that sends a heartbeat to the others. It does not have to be high frequency; e.g every second a pulse of 10ms.

this sounds like the simplest, more plausible thing to do. I have no idea where to start. would you guide me a bit?

What part confuses you? Can you make a pin change state every 10ms? If not see the blink without delay example. Can you read the state of a pin on the other Arduino? If not see the reference on digitalRead. Can you count the number of pulses and use that instead of millis? How much have you tried? Or did you just jump straight to, "I can't "?

camilozk: Is there a way to connect the 3 arduinos so they share the same clock or something like this?

There is. However, you may have to remove the crystal / resonator from the slaves and you will have to solder a wire between the boards.

Why three Arduinos for three LED strips. A single Mega should be able to do that. Leo..

A single Mega should be able to do that

I am sure it should, but I would anyway like to learn how to do this since I could probably apply it to other ideas. Also, the program that I am using was not written by myself and it is way beyond my current knowledge. I dont think I can try to modify this sketch to drive more than one Led strip with more than one bmp file right know, but I do think I might find a quicker solution to have the 3 boards working at the same pace.

However, you may have to remove the crystal / resonator from the slaves and you will have to solder a wire between the boards.

I will see what I find around about this. thanks

How much have you tried? Or did you just jump straight to, "I can’t "?

Thank you very much for your encouraging message Delta_G. It sound like you are the right person to guide someone who is asking for assistance in a forum. If I understand correctly the approach you refer to, and please apologize me in advance if I dont, this would imply that my sketch uses “millis” as a timer, which I cant find in the sketch (I upload the code here if someone want to check it out. credits @ http://mrossphoto.com/digital-light-wand/). I was hoping to find a more hardware-related way to interconnect the boards, as the idea Coding Badly shared. If you would like to check the code and share your mind, I am more than happy to listen your positive contribution.

#include <Adafruit_NeoPixel.h>          
#include <SD.h>                          
#include <SPI.h>                         

#define SDssPin 53                       
int NPPin = 23;                          
int g = 0;                               
int b = 0;                               
int r = 0;                               

#define STRIP_LENGTH 20               
int frameDelay = 10;                      
int menuItem = 1;                        
int initDelay = 0;                        
int repeat = 0;                           
int repeatDelay = 0;                      
int updateMode = 0;                       
int repeatTimes = 1;                      
int brightness = 99;                      

byte x;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];                  
long buffer[STRIP_LENGTH];
     

void setup() {
  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}
  

void setupLEDs() {
  strip.begin();
  strip.show();
}

     
void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}
     

void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp,14);
     
  dataFile = SD.open(temp);
     
  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }  
  else {
    delay(1000);
    setupSDcard();
    return;
    }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for(x=0;x<STRIP_LENGTH;x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;
     
  incomingbyte=readByte();
  retValue=(uint32_t)((byte)incomingbyte);
     
  incomingbyte=readByte();
  retValue+=(uint32_t)((byte)incomingbyte)<<8;
     
  incomingbyte=readByte();
  retValue+=(uint32_t)((byte)incomingbyte)<<16;
     
  incomingbyte=readByte();
  retValue+=(uint32_t)((byte)incomingbyte)<<24;
     
  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;
     
  incomingbyte=readByte();
  retValue+=(uint16_t)((byte)incomingbyte);
     
  incomingbyte=readByte();
  retValue+=(uint16_t)((byte)incomingbyte)<<8;
     
  return retValue;
}


int readByte() {
  int retbyte=-1;
  while(retbyte<0) retbyte= dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g=gamma(readByte())/(101-brightness);
  b=gamma(readByte())/(101-brightness);
  r=gamma(readByte())/(101-brightness);
}


void ReadTheFile() {
  #define MYBMP_BF_TYPE           0x4D42
  #define MYBMP_BF_OFF_BITS       54
  #define MYBMP_BI_SIZE           40
  #define MYBMP_BI_RGB            0L
  #define MYBMP_BI_RLE8           1L
  #define MYBMP_BI_RLE4           2L
  #define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;
     
  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }
    
  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();
   
  /* Check info header */
  if( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
    imgHeight <= 0 || imgPlanes != 1 ||
    imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
    imgSizeImage == 0 )
    {
    delay(1000);
    return;
  }
     
  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;           
  }
     
     
  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;
    

    // Note:  
    // The x,r,b,g sequence below might need to be changed if your strip is displaying
    // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
    // Change the order if needed to make the colors correct.
    
    for(int y=imgHeight; y > 0; y--) {
      int bufpos=0;    
      for(int x=0; x < displayWidth; x++) {
        uint32_t offset = (MYBMP_BF_OFF_BITS + (((y-1)* lineLength) + (x*3))) ;
        dataFile.seek(offset);
        
        getRGBwithGamma();

        strip.setPixelColor(x,r,b,g);
        
      }
    latchanddelay(frameDelay);
    }
  }


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99,100,101,102,104,105,106,107,108,
  109,110,111,113,114,115,116,117,118,120,121,122,123,125,126,127
};
 
 
inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

Is there a way to connect the 3 arduinos so they share the same clock or something like this?

Well I got an Idea!

If you use 3x Arduinos thru I2C you need to make a Master and 2 slaves while back posting in the other topic i wrote a small time clock code, it was for a guy that use a relay..etc but that doesn't mater, what matters is you need to put the time clock in each arduino.

Code:

// Domino60
// set your rime here 
int hours = 24;   // set hours
int minits = 59;  // set minit
int seconds = 50; // set seconds

// not really need but it add them as example
// add your necesary seconds x_seconds
int x_seconds = 10000; // turn relay for x seconds  , 10000ms = 10seconds
int y_minits;  // every y minits

void setup(){
  Serial.begin(9600);
}

unsigned long now = 0;
void time_(){  // real time clock function 
   
    if(millis() - now >= 1000){ //runs this funtion every second
       seconds++;
       if(seconds == 60){
         minits++;
         seconds = 0;
       }
       if(minits == 60){
         hours++;
         minits = 0;
         seconds = 0;
         
       }
       if(hours >24){
         hours = 0; 
       }
       now = millis();
       Serial.print(hours);
       Serial.print(":");
       Serial.print(minits);
       Serial.print(":");
       Serial.println(seconds);
    }
}


unsigned long now_2;
void relay(){  // relay function turn ON for x seconds every y minits
    if(y_minits == 0 || y_minits == 30){ //
       if(millis() - now_2 == x_seconds){
          // RUN YOUR RELAY ON  
       }
       else{
         // RELAY OFF 
       }
        now_2 = millis();
    }
}
void loop(){
  time_();
  relay();
  
}


// Domino60

Now while you put the time clock in each arduino the Master gonna send 3 values to Slave1 and Slave2 gonna send Hours, minits, seconds, so in that way the Slave1 and Slave2 gonna be time synchronized with the Master. Like 3 people who have 3 hand watches they all have the same time.

Adapting your led strip code with the time the led strip gonna always light up at the same time with the other ones.

Job is done.

D.60

With the original code (reply #7), you can use the master to change the state of a pin every time something needs to happen. The slave will wait for this state change and not use a delay. Except for some supporting stuff in setup(), the change is in the function ReadTheFile().

master

#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

#define SDssPin 53
int NPPin = 23;
int g = 0;
int b = 0;
int r = 0;

#define STRIP_LENGTH 20
int frameDelay = 10;
int menuItem = 1;
int initDelay = 0;
int repeat = 0;
int repeatDelay = 0;
int updateMode = 0;
int repeatTimes = 1;
int brightness = 99;

byte x;


// added sync capability
// sync output pin
const byte syncoutPin = 8;


Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];
long buffer[STRIP_LENGTH];


void setup() {
  // added sync capability
  // configure master sync pin for output
  // start with HIGH; this allows to use INPUT_PULLUP at the slave side
  digitalWrite(syncoutPin, HIGH);
  pinMode(syncoutPin, OUTPUT);

  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}


void setupLEDs() {
  strip.begin();
  strip.show();
}


void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for (x = 0; x < STRIP_LENGTH; x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = gamma(readByte()) / (101 - brightness);
  b = gamma(readByte()) / (101 - brightness);
  r = gamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.

  for (int y = imgHeight; y > 0; y--) {
    // added sync capability
    // the master toggles the sync out pin for every line
    digitalWrite(syncoutPin, !digitalRead(syncoutPin));

    int bufpos = 0;
    for (int x = 0; x < displayWidth; x++) {
      uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + (x * 3))) ;
      dataFile.seek(offset);

      getRGBwithGamma();

      strip.setPixelColor(x, r, b, g);

    }
    latchanddelay(frameDelay);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

Do a search for added sync capabilty in the above code. This master code will toggle the syncout pin for every line that needs to be displayed.

Code too big to fit in one post, so the slave in the next post.

Note: I have no means to test this; only the principle.

slave

#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

#define SDssPin 53
int NPPin = 23;
int g = 0;
int b = 0;
int r = 0;

#define STRIP_LENGTH 20
int frameDelay = 10;
int menuItem = 1;
int initDelay = 0;
int repeat = 0;
int repeatDelay = 0;
int updateMode = 0;
int repeatTimes = 1;
int brightness = 99;

byte x;

// added sync capability
// sync input pin
const byte syncinPin = 9;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];
long buffer[STRIP_LENGTH];


void setup() {
  // added sync capability
  // configure slave sync pin for input
  pinMode(syncinPin, INPUT_PULLUP);

  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}


void setupLEDs() {
  strip.begin();
  strip.show();
}


void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for (x = 0; x < STRIP_LENGTH; x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = gamma(readByte()) / (101 - brightness);
  b = gamma(readByte()) / (101 - brightness);
  r = gamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.

  // added sync capability
  // last sync state; initial state reflects startup state of master
  static bool lastSyncstate = HIGH;

  for (int y = imgHeight; y > 0; y--) {
    // added sync capability
    // the slave waits for a change before the next line is processed
    // wait for state to change
    while (digitalRead(syncinPin) == lastSyncstate);
    // remember last state
    lastSyncstate = !lastSyncstate;

    int bufpos = 0;
    for (int x = 0; x < displayWidth; x++) {
      uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + (x * 3))) ;
      dataFile.seek(offset);

      getRGBwithGamma();

      strip.setPixelColor(x, r, b, g);

    }
    // added sync capability
    // we do not need this anymore
    //latchanddelay(frameDelay);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

Note that the master and slave use different pins; you can adjust to your needs.

Thanks for the advice people! I am going to be checking these possibilities out and come back with results!

back with news. I have tried the idea suggested by sterretje with no success; the master starts displaying the program but the slave displays nothing.

I put a jumper cable from the master´s digital pin 8 to the slave´s digital pin 9. The grounds are connected since both boards are sharing the power supply.

I will copy again the original code, the master code and the slave code just in case in the next 3 posts.

original

#include <Adafruit_NeoPixel.h>          
#include <SD.h>                          
#include <SPI.h>                         

#define SDssPin 53                       
int NPPin = 23;                          
int g = 0;                               
int b = 0;                               
int r = 0;                               

#define STRIP_LENGTH 1               
int frameDelay = 100;                      
int menuItem = 1;                        
int initDelay = 0;                        
int repeat = 0;                           
int repeatDelay = 0;                      
int updateMode = 0;                       
int repeatTimes = 1;                      
int brightness = 99;                      

byte x;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];                  
long buffer[STRIP_LENGTH];
     

void setup() {
  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}
  

void setupLEDs() {
  strip.begin();
  strip.show();
}

     
void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}
     

void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp,14);
     
  dataFile = SD.open(temp);
     
  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }  
  else {
    delay(1000);
    setupSDcard();
    return;
    }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for(x=0;x<STRIP_LENGTH;x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;
     
  incomingbyte=readByte();
  retValue=(uint32_t)((byte)incomingbyte);
     
  incomingbyte=readByte();
  retValue+=(uint32_t)((byte)incomingbyte)<<8;
     
  incomingbyte=readByte();
  retValue+=(uint32_t)((byte)incomingbyte)<<16;
     
  incomingbyte=readByte();
  retValue+=(uint32_t)((byte)incomingbyte)<<24;
     
  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;
     
  incomingbyte=readByte();
  retValue+=(uint16_t)((byte)incomingbyte);
     
  incomingbyte=readByte();
  retValue+=(uint16_t)((byte)incomingbyte)<<8;
     
  return retValue;
}


int readByte() {
  int retbyte=-1;
  while(retbyte<0) retbyte= dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g=gamma(readByte())/(101-brightness);
  b=gamma(readByte())/(101-brightness);
  r=gamma(readByte())/(101-brightness);
}


void ReadTheFile() {
  #define MYBMP_BF_TYPE           0x4D42
  #define MYBMP_BF_OFF_BITS       54
  #define MYBMP_BI_SIZE           40
  #define MYBMP_BI_RGB            0L
  #define MYBMP_BI_RLE8           1L
  #define MYBMP_BI_RLE4           2L
  #define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;
     
  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }
    
  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();
   
  /* Check info header */
  if( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
    imgHeight <= 0 || imgPlanes != 1 ||
    imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
    imgSizeImage == 0 )
    {
    delay(1000);
    return;
  }
     
  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;           
  }
     
     
  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;
    

    // Note:  
    // The x,r,b,g sequence below might need to be changed if your strip is displaying
    // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
    // Change the order if needed to make the colors correct.
    
    for(int y=imgHeight; y > 0; y--) {
      int bufpos=0;    
      for(int x=0; x < displayWidth; x++) {
        uint32_t offset = (MYBMP_BF_OFF_BITS + (((y-1)* lineLength) + (x*3))) ;
        dataFile.seek(offset);
        
        getRGBwithGamma();

        strip.setPixelColor(x,r,b,g);
        
      }
    latchanddelay(frameDelay);
    }
  }


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99,100,101,102,104,105,106,107,108,
  109,110,111,113,114,115,116,117,118,120,121,122,123,125,126,127
};
 
 
inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

master

#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

#define SDssPin 53
int NPPin = 23;
int g = 0;
int b = 0;
int r = 0;

#define STRIP_LENGTH 1
int frameDelay = 100;
int menuItem = 1;
int initDelay = 0;
int repeat = 0;
int repeatDelay = 0;
int updateMode = 0;
int repeatTimes = 1;
int brightness = 99;

byte x;


// added sync capability
// sync output pin
const byte syncoutPin = 8;


Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];
long buffer[STRIP_LENGTH];


void setup() {
  // added sync capability
  // configure master sync pin for output
  // start with HIGH; this allows to use INPUT_PULLUP at the slave side
  pinMode(syncoutPin, OUTPUT);
  digitalWrite(syncoutPin, HIGH);

  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}


void setupLEDs() {
  strip.begin();
  strip.show();
}


void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for (x = 0; x < STRIP_LENGTH; x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = gamma(readByte()) / (101 - brightness);
  b = gamma(readByte()) / (101 - brightness);
  r = gamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.

  for (int y = imgHeight; y > 0; y--) {
    // added sync capability
    // the master toggles the sync out pin for every line
    digitalWrite(syncoutPin, !digitalRead(syncoutPin));

    int bufpos = 0;
    for (int x = 0; x < displayWidth; x++) {
      uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + (x * 3))) ;
      dataFile.seek(offset);

      getRGBwithGamma();

      strip.setPixelColor(x, r, b, g);

    }
    latchanddelay(frameDelay);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

slave

#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

#define SDssPin 53
int NPPin = 23;
int g = 0;
int b = 0;
int r = 0;

#define STRIP_LENGTH 1
int frameDelay = 100;
int menuItem = 1;
int initDelay = 0;
int repeat = 0;
int repeatDelay = 0;
int updateMode = 0;
int repeatTimes = 1;
int brightness = 99;

byte x;

// added sync capability
// sync input pin
const byte syncinPin = 9;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];
long buffer[STRIP_LENGTH];


void setup() {
  // added sync capability
  // configure slave sync pin for input
  pinMode(syncinPin, INPUT_PULLUP);

  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}


void setupLEDs() {
  strip.begin();
  strip.show();
}


void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for (x = 0; x < STRIP_LENGTH; x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = gamma(readByte()) / (101 - brightness);
  b = gamma(readByte()) / (101 - brightness);
  r = gamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.

  // added sync capability
  // last sync state; initial state reflects startup state of master
  static bool lastSyncstate = HIGH;

  for (int y = imgHeight; y > 0; y--) {
    // added sync capability
    // the slave waits for a change before the next line is processed
    // wait for state to change
    while (digitalRead(syncinPin) == lastSyncstate);
    // remember last state
    lastSyncstate = !lastSyncstate;

    int bufpos = 0;
    for (int x = 0; x < displayWidth; x++) {
      uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + (x * 3))) ;
      dataFile.seek(offset);

      getRGBwithGamma();

      strip.setPixelColor(x, r, b, g);

    }
    // added sync capability
    // we do not need this anymore
    //latchanddelay(frameDelay);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

Maybe start simple to test the principle. master

// Master
const byte ledPin = 13;
const byte syncoutPin = 8;

void setup()
{
  pinMode(syncoutPin, OUTPUT);
  digitalWrite(ledPin, HIGH);

  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
}

void loop()
{
  // toggle sync pin
  digitalWrite(syncoutPin, !digitalRead(syncoutPin));
  // toggle led on master
  digitalWrite(ledPin, !digitalRead(ledPin));
  delay(1000);
}

slave

// Slave
const byte ledPin = 13;
const byte syncinPin = 9;


void setup()
{
  Serial.begin(115200);
  
  pinMode(syncinPin, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
}

void loop()
{
  static byte lastSyncState = HIGH;

  // blocking (!!) wait for sync state change
  while (digitalRead(syncinPin) != lastSyncState);

  // some debug
  Serial.println("syncin state changed: ");

  // toggle led on slave
  digitalWrite(ledPin, !digitalRead(ledPin));
  // update last sync state
  lastSyncState = !lastSyncState;
}

If it works, start building around that.

Add some debugging capabilities to the code; Serial.print/ln and/or toggling of pin13 in both the master and the slave. You can have two serial monitors (or other terminal programs) open side by side, one for master and one for slave.

thanks sterretje. synchronized blink works as a charm. As a matter of fact, I modified some things in the codes that I want to use, and what I have is the following:

-the master is sending the color information to the led strip correctly, and is also sending the change of state to the slave.

-the slave is perfectly synchronized with the master, but is sending no information to the led strip.

if you could look at it I would really appreciate it.

master

#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

#define SDssPin 53
int NPPin = 23;
int g = 0;
int b = 0;
int r = 0;

#define STRIP_LENGTH 1
int frameDelay = 500;
int menuItem = 1;
int initDelay = 0;
int repeat = 0;
int repeatDelay = 0;
int updateMode = 0;
int repeatTimes = 1;
int brightness = 99;

byte x;


// added sync capability
// sync output pin
const byte syncoutPin = 8;


Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];
long buffer[STRIP_LENGTH];


void setup() {
  Serial.begin(115200);
  // added sync capability
  // configure master sync pin for output
  // start with HIGH; this allows to use INPUT_PULLUP at the slave side
  pinMode(syncoutPin, OUTPUT);
  digitalWrite(syncoutPin, HIGH);

  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}


void setupLEDs() {
  strip.begin();
  strip.show();
}


void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for (x = 0; x < STRIP_LENGTH; x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = gamma(readByte()) / (101 - brightness);
  b = gamma(readByte()) / (101 - brightness);
  r = gamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.

  for (int y = imgHeight; y > 0; y--) {
    
    // added sync capability
    // the master toggles the sync out pin for every line
    digitalWrite(syncoutPin, !digitalRead(syncoutPin));

    // some debug
    Serial.println("syncin state changed: ");

    int bufpos = 0;
    for (int x = 0; x < displayWidth; x++) {
      uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + (x * 3))) ;
      dataFile.seek(offset);

      getRGBwithGamma();

      strip.setPixelColor(x, r, b, g);

    }
    latchanddelay(frameDelay);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}

slave

#include <Adafruit_NeoPixel.h>
#include <SD.h>
#include <SPI.h>

#define SDssPin 53
int NPPin = 23;
int g = 0;
int b = 0;
int r = 0;

#define STRIP_LENGTH 1
int frameDelay = 100;
int menuItem = 1;
int initDelay = 0;
int repeat = 0;
int repeatDelay = 0;
int updateMode = 0;
int repeatTimes = 1;
int brightness = 99;

byte x;

// added sync capability
// sync input pin
const byte syncinPin = 9;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, NPPin, NEO_GRB + NEO_KHZ800);

File root;
File dataFile;
String m_CurrentFilename = "";
int m_FileIndex = 0;
int m_NumberOfFiles = 0;
String m_FileNames[200];
long buffer[STRIP_LENGTH];


void setup() {
  Serial.begin(115200);
  // added sync capability
  // configure slave sync pin for input
  pinMode(syncinPin, INPUT_PULLUP);

  setupLEDs();
  setupSDcard();
}


void loop() {
  SendFile("set01.bmp");
}


void setupLEDs() {
  strip.begin();
  strip.show();
}


void setupSDcard() {
  pinMode(SDssPin, OUTPUT);
  while (!SD.begin(SDssPin)) {
  }
}


void SendFile(String Filename) {
  char temp[14];
  Filename.toCharArray(temp, 14);

  dataFile = SD.open(temp);

  if (dataFile) {
    ReadTheFile();
    dataFile.close();
  }
  else {
    delay(1000);
    setupSDcard();
    return;
  }
}


void latchanddelay(int dur) {
  strip.show();
  delay(dur);
}


void ClearStrip(int duration) {
  int x;
  for (x = 0; x < STRIP_LENGTH; x++) {
    strip.setPixelColor(x, 0);
  }
  strip.show();
}


uint32_t readLong() {
  uint32_t retValue;
  byte incomingbyte;

  incomingbyte = readByte();
  retValue = (uint32_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 8;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 16;

  incomingbyte = readByte();
  retValue += (uint32_t)((byte)incomingbyte) << 24;

  return retValue;
}



uint16_t readInt() {
  byte incomingbyte;
  uint16_t retValue;

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte);

  incomingbyte = readByte();
  retValue += (uint16_t)((byte)incomingbyte) << 8;

  return retValue;
}


int readByte() {
  int retbyte = -1;
  while (retbyte < 0) retbyte = dataFile.read();
  return retbyte;
}


void getRGBwithGamma() {
  g = gamma(readByte()) / (101 - brightness);
  b = gamma(readByte()) / (101 - brightness);
  r = gamma(readByte()) / (101 - brightness);
}


void ReadTheFile() {
#define MYBMP_BF_TYPE           0x4D42
#define MYBMP_BF_OFF_BITS       54
#define MYBMP_BI_SIZE           40
#define MYBMP_BI_RGB            0L
#define MYBMP_BI_RLE8           1L
#define MYBMP_BI_RLE4           2L
#define MYBMP_BI_BITFIELDS      3L

  uint16_t bmpType = readInt();
  uint32_t bmpSize = readLong();
  uint16_t bmpReserved1 = readInt();
  uint16_t bmpReserved2 = readInt();
  uint32_t bmpOffBits = readLong();
  bmpOffBits = 54;

  /* Check file header */
  if (bmpType != MYBMP_BF_TYPE || bmpOffBits != MYBMP_BF_OFF_BITS) {
    delay(1000);
    return;
  }

  /* Read info header */
  uint32_t imgSize = readLong();
  uint32_t imgWidth = readLong();
  uint32_t imgHeight = readLong();
  uint16_t imgPlanes = readInt();
  uint16_t imgBitCount = readInt();
  uint32_t imgCompression = readLong();
  uint32_t imgSizeImage = readLong();
  uint32_t imgXPelsPerMeter = readLong();
  uint32_t imgYPelsPerMeter = readLong();
  uint32_t imgClrUsed = readLong();
  uint32_t imgClrImportant = readLong();

  /* Check info header */
  if ( imgSize != MYBMP_BI_SIZE || imgWidth <= 0 ||
       imgHeight <= 0 || imgPlanes != 1 ||
       imgBitCount != 24 || imgCompression != MYBMP_BI_RGB ||
       imgSizeImage == 0 )
  {
    delay(1000);
    return;
  }

  int displayWidth = imgWidth;
  if (imgWidth > STRIP_LENGTH) {
    displayWidth = STRIP_LENGTH;
  }


  /* compute the line length */
  uint32_t lineLength = imgWidth * 3;
  if ((lineLength % 4) != 0)
    lineLength = (lineLength / 4 + 1) * 4;


  // Note:
  // The x,r,b,g sequence below might need to be changed if your strip is displaying
  // incorrect colors.  Some strips use an x,r,b,g sequence and some use x,r,g,b
  // Change the order if needed to make the colors correct.

  // added sync capability
  // last sync state; initial state reflects startup state of master
  static bool lastSyncState = HIGH;

  for (int y = imgHeight; y > 0; y--) {
    // added sync capability
    // the slave waits for a change before the next line is processed
    // wait for state to change
    while (digitalRead(syncinPin) == lastSyncState);
    // some debug
    Serial.println("syncin state changed: ");
    // remember last state
    lastSyncState = !lastSyncState;

    int bufpos = 0;
    for (int x = 0; x < displayWidth; x++) {
      uint32_t offset = (MYBMP_BF_OFF_BITS + (((y - 1) * lineLength) + (x * 3))) ;
      dataFile.seek(offset);

      getRGBwithGamma();

      strip.setPixelColor(x, r, b, g);

    }
    // added sync capability
    // we do not need this anymore
    //latchanddelay(frameDelay);
  }
}


PROGMEM const char gammaTable[]  = {
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,
  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  9,  9,  9,  9, 10, 10, 10, 10, 11,
  11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16,
  16, 17, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22,
  23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30,
  30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 37, 37, 38, 38, 39,
  40, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 47, 47, 48, 49, 50,
  50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 61, 62,
  62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 74, 75,
  76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
  92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108,
  109, 110, 111, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 125, 126, 127
};


inline byte gamma(byte x) {
  return pgm_read_byte(&gammaTable[x]);
}