Skip to content

Commit 947d42b

Browse files
hf-cloudsEeeeBin
authored andcommitted
Updated mlx90640 (#189)
1. Fixed warnings in the program 2. Fixed bad spots
1 parent eb0b715 commit 947d42b

File tree

3 files changed

+1525
-1286
lines changed

3 files changed

+1525
-1286
lines changed

examples/Unit/MLX90640/MLX90640.ino

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ void loop()
267267
float tr = Ta - TA_SHIFT; //Reflected temperature based on the sensor ambient temperature
268268
float emissivity = 0.95;
269269
MLX90640_CalculateTo(mlx90640Frame, &mlx90640, emissivity, tr, pixels); //save pixels temp to array (pixels)
270+
int mode_ = MLX90640_GetCurMode(MLX90640_address);
271+
//amendment
272+
MLX90640_BadPixelsCorrection((&mlx90640)->brokenPixels, pixels, mode_, &mlx90640);
273+
//MLX90640_BadPixelsCorrection((&mlx90640)->outlierPixels, pixels, mode_, &mlx90640);
270274
}
271275

272276
//Reverse image (order of Integer array)
@@ -405,15 +409,15 @@ void loop()
405409
}
406410
else
407411
{
408-
M5.Lcd.printf("Min:", 1);
412+
M5.Lcd.print("Min:");
409413
M5.Lcd.print(min_v, 1);
410-
M5.Lcd.printf("C " , 1);
411-
M5.Lcd.printf("Max:", 1);
414+
M5.Lcd.print("C ");
415+
M5.Lcd.print("Max:");
412416
M5.Lcd.print(max_v, 1);
413-
M5.Lcd.printf("C" , 1);
417+
M5.Lcd.print("C");
414418
M5.Lcd.setCursor(180, 94); // update spot temp text
415419
M5.Lcd.print(spot_v, 1);
416-
M5.Lcd.printf("C" , 1);
420+
M5.Lcd.printf("C");
417421
//M5.Lcd.drawCircle(160, 100, 6, TFT_WHITE); // update center spot icon
418422
//M5.Lcd.drawLine(160, 90, 160, 110, TFT_WHITE); // vertical line
419423
//M5.Lcd.drawLine(150, 100, 170, 100, TFT_WHITE); // horizontal line
@@ -442,11 +446,11 @@ void infodisplay(void) {
442446
M5.Lcd.setTextSize(2);
443447
M5.Lcd.setCursor(284, 222); //move to bottom right
444448
M5.Lcd.print(MAXTEMP , 1); // update MAXTEMP
445-
M5.Lcd.printf("C" , 1);
449+
M5.Lcd.print("C");
446450
M5.Lcd.setCursor(0, 222); // update MINTEMP text
447451
M5.Lcd.fillRect(0, 222, 36, 16, TFT_BLACK);
448452
M5.Lcd.print(MINTEMP , 1);
449-
M5.Lcd.printf("C" , 1);
453+
M5.Lcd.print("C");
450454
M5.Lcd.setCursor(106, 224);
451455
}
452456

0 commit comments

Comments
 (0)