Glitching or flickering of GIGA Display Shield

// Below is the function which upon calling is making the display to flicker.

void read_data(void)
{
  CurrentValue_prev= CurrentValue;
  temperature_prev=temperature;
  
   //start_flag is when the user press start
  if(START_flag == 1)
  {
    digitalWrite(RelayPIN, LOW);
    //-------------------------------read the rtd temp------------------------------
    float rtdResistance = max31865.readRTD(); 
    temperature = max31865.temperature(PT100_RNOMINAL, REF_RESISTOR);
    //--------------------------------------------------------------------------------

    /*If you are reading DC current, use this function to read DC current*/
    CurrentValue=  readDCCurrent(currentSensorPin); 

    //dd_flag is for unit value chosen by the user

    if(dd_flag==1)
    {
      float divide=temperature * 9.0/5;
      temperature=divide+ 32;
      float salt =CurrentValue*0.00220462;
      CurrentValue=salt;
    }
    else if(dd_flag==3)
    {
      CurrentValue= 15; //readDCCurrent(currentSensorPin);
      temperature = 15; //max31865.temperature(PT100_RNOMINAL, REF_RESISTOR);

    }
    else if(dd_flag==7)
    {
      CurrentValue=0;
      temperature=0;
    }
  }
  else
  {
    CurrentValue=0;
    temperature=0;
    digitalWrite(RelayPIN, HIGH);
}



void loop()
{
 
  lv_timer_handler();
  read_data();


  if(CurrentValue_prev!=CurrentValue && START_flag==1)
  {
      lv_example_style_3();
      lv_example_style_4();
      // delay(1000);
  }
  else
  {
    CurrentValue=0;
    temperature=0;
  }
}

I think the above code is the cause of flickering in my display!Do you have any siggestion for solving it? I will upload a gif of the flickering!

ezgif-2-3e258a9557

@anisha I think your readDCCurrent function might be calling analogRead(). This is a known issue for the Giga+display shield and will be fixed in the upcoming core (4.0.10)

okay!Thank you much :smile:.But can you suggest me a way to fix it for now?

You can try replacing libmbed.a (from Arduino15/packages/arduino/hardware/mbed_giga/4.0.6/variants/GIGA/libs ) with the one I'm attaching libmbed.a - Google Drive or wait till the day after tomorrow (at most :slight_smile: ).

Thank you so much it is working :smile: