New help with my project - Remote IR temperature sensor MLX-90614 with LCD 2.4"

Dears
I need help with my code ,as i’m designing an IR temperature detection with MLX-90614 with Arduino MEGA and 2.4 “TFT LCD (mcufriend) and IR proximity sensor .
My code sequence (what i hope) is as following :
1- The 2.4” LCD is displaying BMP files from SD card .
2-when the face come near to the box (as attached pic) its been detected by the IR proximity sensor ,and i want the MLX-90614 to detect the temp. and print it instantly (cut the BMP photo drawing sequence).

My problem is i can’t use the I2c protocol of MLX-90614 & the 2.4" LCD inside the ISR (interrupt) , and what i’m getting now that after any face detection by the IR proximity sensor ,the MLX-90614 detect the temp but it doesn’t print it until the LCD finish the current BMP drawing .

Help please in interrupting drawing the BMP file and print the temp. instantly

Remote_temp._reader.ino (10 KB)

My problem is i can’t use the I2c protocol of MLX-90614 & the 2.4" LCD inside the ISR (interrupt)

.It becomes not-a-problem if you don’t do those things in your ISR.
Why have you even got an ISR?

Ok , i agree with you ISR make alot of trouble, but i'm asking here if i can interrupt the BMP drawing process when somebody cut the IR on the proximity sensor :slight_smile: that's all what i need.

can interrupt the BMP drawing process when somebody cut the IR on the proximity sensor

As long as you haven’t explicitly disabled interrupts, yes, of course you can.

I need help with the code :confused:

all what I need that:
1-The LCD tft is displaying BMP image from SD card.
2-When IR proximity sensor detect face , the MLX-90614 detect the temp and the LCD print it instantly/immediately.
3-after 3 second the LCD is resuming displaying BMP image from SD card.

I need help in the code

Your code is incomplete.
“person” should be qualified “volatile”, but if you didn’t have an interrupt, it wouldn’t need to be.

I don’t know why you have an interrupt.