Reading temperature from all 768 pixels of MLX90640

Working on Qwiic IR Array (MLX90640). Running this code: https://github.com/sparkfun/SparkFun_ML … adings.ino

What I am trying to do is, read temperature value from each pixel and if temperature value from any of the 768 pixel is above 27 (even if one pixel is above 27) turn LED on, otherwise keep it off. For this i have edited the code starting from line 72 as follows:

}

for (int x = 0 ; x < 768 ; x++)  //NEW
  {
    Serial.print("Pixel ");
    Serial.print(x);
    Serial.print(": ");
    Serial.print(mlx90640To[x], 2);
    Serial.print("C");
    Serial.println();
    if(mlx90640To[x]>=27) //NEW
       digitalWrite(ledPin, HIGH);     //NEW
    if(mlx90640To[x]<27) //NEW
       digitalWrite(ledPin, LOW);     //NEW

But this code is not keeping LED on though i am getting many values above 27 degree C on serial monitor. It turns LED on only when temperature gets above 30C and not otherwise. Please help with what is wrong here? and what is better logic.