Hardcore array processing possible for beginner?

I am using a ir-temp sensor which contains 64 ir-sensors alligned in a 8x8 array. The sketch returns a array of 64 double-values. Visually the array is easier to read if I just print int to the serial monitor and add a linebreak after 8th reading so that it look like a 8x8 array in the serial monitor.

But how difficult is it to "track" the highest value as it travels from one side to the other? I would like to be able to drag my hand past the sensor and have some printout when my hand goes from one side to the other.

It isn't difficult at all. Why not simply use the integer values from the sensor?

I find it very difficult to even understand where to begin if I for example tried to "track" the highest value in the simple example below. What kind of methods is needed to have this return a "someone moved to the left" message from analyzing the array? Also the real array is just a array of length 64 which makes it more hard to get a grip of to me.

|500x250

If, in this frame, the hotspot is at (2, 3), and in the last frame, the hotspot was at (1, 3), doesn't that tell you something?

Also the real array is just a array of length 64

How do imagine C represents 2D arrays?

It would be easier to work with the image if you store the data in an 8x8 2D array, rather than try to index it linearly.

Post the code, using code tags.

...or just persuade the compiler that your 64 element vector is an 8x8 matrix.

#include <Wire.h>

byte pixelTempL;
byte pixelTempH;
char addr = 0x68;
float celsius;
float aveTemp;

int irqPin = 2;
int pwmPin = 3;

void setup() {
  Wire.begin();
  Serial.begin(115200);
  
  pinMode(irqPin, INPUT);
  pinMode(pwmPin, OUTPUT);

//  analogWrite(pwmPin, 255);
}

void loop() {
  Serial.print("Grid-EYE:\r\n");
  
  pixelTempL = 0x80;
  aveTemp = 0;
  
  for(int pixel = 0; pixel < 64; pixel++){
    Wire.beginTransmission(addr);
    Wire.write(pixelTempL);
    Wire.endTransmission();
    Wire.requestFrom(addr, 2);
    byte lowerLevel = Wire.read();
    byte upperLevel = Wire.read();

/*    
    Wire.beginTransmission(addr);
    Wire.write(pixelTempH);
    Wire.endTransmission();
    Wire.requestFrom(addr, 1);
    byte upperLevel = Wire.read();
*/

    int temperature = ((upperLevel << 8) | lowerLevel);
//    int temperature = temp - 2048;
    if (temperature > 2047){
      temperature = temperature - 4096;
//      temperature = -(2048 - temperature);
    }
    
    celsius = temperature * 0.25;
    
    Serial.print(celsius);
    Serial.print(" ");
    if((pixel+1)%8 == 0){
      Serial.print("\r\n");
    }
    
    switch(pixel){
    case 27:
    case 28:
    case 35:
    case 36:
      aveTemp += celsius;
      break;
    default:
      break;
    }
    
    pixelTempL = pixelTempL + 2;
  }
  
  Wire.beginTransmission(addr);
  Wire.write(0x0E);
  Wire.endTransmission();
  Wire.requestFrom(addr, 2);
  byte upperLevelTherm = Wire.read();
  byte lowerLevelTherm = Wire.read();
  
/*
  Wire.beginTransmission(addr);
  Wire.write(0x0F);
  Wire.endTransmission();
  Wire.requestFrom(addr, 1);
  byte lowerLevelTherm = Wire.read();
*/

  int temperatureTherm = ((lowerLevelTherm << 8) | upperLevelTherm);
  
  float celsiusTherm = temperatureTherm * 0.0625;
  
  Serial.print(celsiusTherm);
  Serial.print("\r\n\r\n");
  
  aveTemp *= 0.25;
  
  
  delay(25);
}

AdaFruit also have some examples: adafruit examples

burton666: What kind of methods is needed to have this return a "someone moved to the left" message from analyzing the array?

The field of study this calls on is called pattern recognition and is a thing that is easy for you to do but hard for a computer. Therefore it is hard to program this to get what you would consider a good result.

What you need to do is to find the X-Y values for the "hot spot". If you have a liner array representing your physical two dimensional array you need to know how it is made up in order to come up with a way of converting the linear array value into an X-Y pair. This is the inverse of what you have to do when making an LED matrix from an addressable strip.

So suppose your array has the first 8 elements along the bottom row then the X coordinate is simply the remainder of the sensor number divided by 8 ( this is called the mod and the symbol for this is % ) and the Y coordinate is the integer result of dividing the sensor number divided by 8.

So find the hot spot coordinate pair and store it. Then scan again and find the new coordinate pair. Then you subtract one pair from the other to find the delta ( or difference ) between the two. If their has been sufficient change in say the X direction you can then output a message saying "Moved to the Left" or "Moved up".

The Grid-EYE stores and transmits image pixels from right to left, bottom to top, which is a bit inconvenient.

As the values come in, I store them in an 8x8 array with the row order reversed, which makes blob indexing and identification with location in room a little easier.

image.png