Particle blinkind red after firmware flashing

hi every time i flash the firmware that i attach here, my argon blinks red 8 times. Do you know why?

#include "Particle.h"
#include <MQTT.h>
#include <Adafruit_Sensor.h>
#include <Grove_ChainableLED.h>
#include <TCA9548A-RK.h>
#include <Adafruit_MLX90393_SSSA.h>
#include <Adafruit_BNO055_Library_SSSA.h>

/* BNO055
   Connections
   ===========
   Connect SCL to analog 5
   Connect SDA to analog 4
   Connect VDD to 3.3V DC
   Connect GROUND to common ground
*/
SYSTEM_MODE(AUTOMATIC);
SYSTEM_THREAD(ENABLED);
/* Set the delay between fresh samples */
#define BNO055_SAMPLERATE_DELAY_MS (100)
#define TCAADDR 0x70
#define MLX90393_CS 10
#define MAGADDR 0X0C

// Check I2C device address and correct line below (by default address is 0x29 or 0x28)
//                                   id, address
Adafruit_BNO055 bno = Adafruit_BNO055(55,0x28);
Adafruit_MLX90393 sensor1 = Adafruit_MLX90393();
Adafruit_MLX90393 sensor2 = Adafruit_MLX90393();
Adafruit_MLX90393 sensor3 = Adafruit_MLX90393();
Adafruit_MLX90393 sensor4 = Adafruit_MLX90393();
Adafruit_MLX90393 sensor5 = Adafruit_MLX90393();


void tcaselect(uint8_t i)
{
      if (i > 7) return;
     
      Wire.beginTransmission(TCAADDR);
      Wire.write(1 << i);
      Wire.endTransmission();  
}
  

void setup()
{ 
  Serial.begin(9600);
  //Serial.println("Orientation Sensor Raw Data Test"); Serial.println("");
  Wire.begin();
  /* Initialise the sensor */
  /*----------------IMU----------------------*/
  tcaselect(5);
  delay(100);
  
  if(!bno.begin())
  {/* There was a problem detecting the BNO055 ... check your connections */
  Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
  }
  else{
    //Serial.println("  IMU ok");
    }
   bno.setExtCrystalUse(true);
   delay(100);
 
   /*-------------SENSORE 1----------------------*/

    tcaselect(0);
    delay(100);
    if (! sensor1.begin_I2C(0x0C)) {          // hardware I2C mode, can pass in address & alt Wire
    Serial.println("No sensor 1 found ... check your wiring?");
    
   }
   else{
   //Serial.println("  S1 ok");
    }
    sensor1.setGain(MLX90393_GAIN_5X);
    sensor1.setResolution(MLX90393_X, MLX90393_RES_16);
    sensor1.setResolution(MLX90393_Y, MLX90393_RES_16);
    sensor1.setResolution(MLX90393_Z, MLX90393_RES_16);
    // Set oversampling
    sensor1.setOversampling(MLX90393_OSR_0);

  // Set digital filtering
    sensor1.setFilter(MLX90393_FILTER_5);
   /*---------------SENSORE 2----------------------------------*/
 
    tcaselect(1);
    delay(100);
       if (! sensor2.begin_I2C(0x0C)) {          // hardware I2C mode, can pass in address & alt Wire
    Serial.println("No sensor 2 found ... check your wiring?");

   }
   else{
  //Serial.println("  S2 ok");
    }
    sensor2.setGain(MLX90393_GAIN_5X);
    sensor2.setResolution(MLX90393_X, MLX90393_RES_16);
    sensor2.setResolution(MLX90393_Y, MLX90393_RES_16);
    sensor2.setResolution(MLX90393_Z, MLX90393_RES_16);
    // Set oversampling
  sensor2.setOversampling(MLX90393_OSR_0);

  // Set digital filtering
  sensor2.setFilter(MLX90393_FILTER_5);
  
  /*-------------SENSORE 3--------------------------*/
     tcaselect(2);
    delay(100);
   if (! sensor3.begin_I2C(0x0C)) {          // hardware I2C mode, can pass in address & alt Wire
    Serial.println("No sensor 3 found ... check your wiring?");
   }
   else{
   //Serial.println("  S3 ok");
    }
    sensor3.setGain(MLX90393_GAIN_5X);
    sensor3.setResolution(MLX90393_X, MLX90393_RES_16);
    sensor3.setResolution(MLX90393_Y, MLX90393_RES_16);
    sensor3.setResolution(MLX90393_Z, MLX90393_RES_16);
    // Set oversampling
    sensor3.setOversampling(MLX90393_OSR_0);

  // Set digital filtering
    sensor3.setFilter(MLX90393_FILTER_5);
 
    /*-------------SENSORE 4--------------------------*/
     tcaselect(3);
    delay(100);
   if (! sensor4.begin_I2C(0x0C)) {          // hardware I2C mode, can pass in address & alt Wire
    Serial.println("No sensor 4 found ... check your wiring?");
   }
   else{
    //Serial.println("  S4 ok");
    }
    sensor4.setGain(MLX90393_GAIN_5X);
    sensor4.setResolution(MLX90393_X, MLX90393_RES_16);
    sensor4.setResolution(MLX90393_Y, MLX90393_RES_16);
    sensor4.setResolution(MLX90393_Z, MLX90393_RES_16);
    // Set oversampling
  sensor4.setOversampling(MLX90393_OSR_0);

  // Set digital filtering
  sensor4.setFilter(MLX90393_FILTER_5);

     /*-------------SENSORE 5--------------------------*/
     tcaselect(5);
    delay(100);
   if (! sensor5.begin_I2C(0x0C)) {          // hardware I2C mode, can pass in address & alt Wire
    Serial.println("No sensor 4 found ... check your wiring?");
   }
   else{
   //Serial.println("  S5 ok");
    }
    sensor5.setGain(MLX90393_GAIN_1X);
    sensor5.setResolution(MLX90393_X, MLX90393_RES_16);
    sensor5.setResolution(MLX90393_Y, MLX90393_RES_16);
    sensor5.setResolution(MLX90393_Z, MLX90393_RES_16);
    // Set oversampling
  sensor5.setOversampling(MLX90393_OSR_0);

  // Set digital filtering
  sensor5.setFilter(MLX90393_FILTER_5);
   
};
/**************************************************************************/
/*
    Arduino loop function, called once 'setup' is complete (your own code
    should go here)
*/
/**************************************************************************/
void loop()
{
  delay(1000);
  tcaselect(5);
  sensors_event_t event; 
  bno.getEvent(&event);
  if(!bno.begin())
  {/* There was a problem detecting the BNO055 ... check your connections */
  Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
  }
  else{
    Serial.println("  IMU ok");
    }
     delay(100);
  

 imu::Vector<3> mag= bno.getVector(Adafruit_BNO055::VECTOR_MAGNETOMETER );
/* Display the quat data */
float Magx,Magy,Magz;
float x1, y1, z1;
float x2, y2, z2;
float x3, y3, z3;
float x4, y4, z4;
float x5, y5, z5;

 Magx=mag.x();
 Magy=mag.y();
 Magz=mag.z();
 delay(200);
 
Particle.publish("MagX: ", String(Magx));
delay(1);
Particle.publish("MagY: ", String(Magy));
delay(1);
Particle.publish("MagZ:",String(Magz));
delay(1);

  // get X Y and Z data at once
     tcaselect(0);
     if (! sensor1.begin_I2C(0x0C)) {          // hardware I2C mode, can pass in address & alt Wire
    Serial.println("No sensor 1 found ... check your wiring?");
    }
    sensor1.readData(&x1, &y1, &z1);
     delay(100);
    Particle.publish("X1: ",String(x1));
    delay(500);
    Particle.publish("Y1: ",String(y1));
    delay(500);
    Particle.publish("Z1: ",String(z1));
    delay(500);
     
  if (sensor1.readData(&x1, &y1, &z1)) {
      Serial.println("  S1 ok");
    
  } else {
      Serial.println("Unable to read XYZ data from the sensor 1.");
  }
  
   tcaselect(1);
   sensor2.readData(&x2, &y2,&z2);
   
   delay(100);
    Particle.publish("X2: ",String(x2));
      delay(500);
    Particle.publish("Y2: ",String(y2));
      delay(500);
    Particle.publish("Z2: ",String(z2));
     delay(500);
   
if (sensor2.readData(&x2, &y2,&z2)) {
     Serial.println("  S2 ok");

  } else {
      Serial.println("Unable to read XYZ data from the sensor 2.");
  }

tcaselect(2);
sensor3.readData(&x3, &y3, &z3);

delay(100);
 Particle.publish("X3: ",String(x3));
     delay(500);
 Particle.publish("Y3: ",String(y3));
     delay(500);
Particle.publish("Z3: ",String(z3));
      delay(500);
      
if (sensor3.readData(&x3, &y3, &z3)) {
      Serial.println("  S3 ok");
    
  } else {
      Serial.println("Unable to read XYZ data from the sensor 3.");
  }

tcaselect(3);
sensor4.readData(&x4, &y4, &z4);
delay(100);
if (sensor4.readData(&x4, &y4, &z4)) {
      Serial.println("  S4 ok");
  } else {
      Serial.println("Unable to read XYZ data from the sensor 4.");
  }

tcaselect(4);
sensor5.readData(&x5, &y5, &z5);

delay(100);
Particle.publish("X5: ",String(x5));
delay(500);
Particle.publish("Y5: ",String(y5));
delay(500);
 Particle.publish("Z5: ",String(z5));
delay(500);

if (sensor5.readData(&x5, &y5, &z5)) {
     Serial.println("  S5 ok");
  } else {
      Serial.println("Unable to read XYZ data from the sensor 5.");
  }
 delay(100);
 
 

}

2 posts were merged into an existing topic: Argon blinking red