Skip to content

Reading all temperature values from 768 pixels simultaneously and checking the numbers #20

@h-Naima-s

Description

@h-Naima-s

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<768]>=27) //NEW
   digitalWrite(ledPin, HIGH);     //NEW
if(mlx90640To[x<768]<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. How to make the code to check for all x between 0 to 768, if anything is above 27 C?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions