add waterSpillLevel, waterSpillSpotCount for overall sensor data uplink
This commit is contained in:
parent
d960e1e0fe
commit
51a7e03717
|
@ -20,13 +20,14 @@ paramsMLX90640 mlx90640;
|
||||||
static uint16_t eeMLX90640[832];
|
static uint16_t eeMLX90640[832];
|
||||||
int status;
|
int status;
|
||||||
volatile uint8_t draw_legend_once=0, normalPeopleTemp=32, blackOutTag=0, waterTempThreshold=8, normalWaterTemp=25, detectCycle=0, v_water_cnt=0,h_water_cnt=0;
|
volatile uint8_t draw_legend_once=0, normalPeopleTemp=32, blackOutTag=0, waterTempThreshold=8, normalWaterTemp=25, detectCycle=0, v_water_cnt=0,h_water_cnt=0;
|
||||||
|
|
||||||
// start with some initial colors
|
// start with some initial colors
|
||||||
float minTemp = 1.0f;
|
float minTemp = 1.0f;
|
||||||
float maxTemp = 60.0f;
|
float maxTemp = 60.0f;
|
||||||
float centerTemp=0.0f;
|
float centerTemp=0.0f;
|
||||||
float averageTemp=0.0f;
|
float averageTemp=0.0f;
|
||||||
volatile uint16_t waterSpillCount=0;
|
volatile uint16_t waterSpillLevel=0, waterSpillSpotCount=0;
|
||||||
|
static uint16_t lastWaterSpillSpotCount=0;
|
||||||
char tempBuffer[128];
|
char tempBuffer[128];
|
||||||
// variables for interpolated colors
|
// variables for interpolated colors
|
||||||
uint8_t red, green, blue;
|
uint8_t red, green, blue;
|
||||||
|
@ -179,7 +180,7 @@ static void drawMeasurement(void ) {
|
||||||
|
|
||||||
BSP_LCD_SetFont(&Font16);
|
BSP_LCD_SetFont(&Font16);
|
||||||
memset(tempBuffer,0,sizeof(tempBuffer));
|
memset(tempBuffer,0,sizeof(tempBuffer));
|
||||||
sprintf(tempBuffer,(char *)"%2d", (uint8_t)max(v_water_cnt, h_water_cnt));
|
sprintf(tempBuffer,(char *)"%2d", waterSpillSpotCount);
|
||||||
BSP_LCD_DisplayStringAt(ST7789V_LCD_PIXEL_WIDTH-60, 15,(uint8_t *)tempBuffer,LEFT_MODE,LCD_COLOR_YELLOW);
|
BSP_LCD_DisplayStringAt(ST7789V_LCD_PIXEL_WIDTH-60, 15,(uint8_t *)tempBuffer,LEFT_MODE,LCD_COLOR_YELLOW);
|
||||||
//APP_LOG(TS_OFF, VLEVEL_L, "%s\r\n",tempBuffer);
|
//APP_LOG(TS_OFF, VLEVEL_L, "%s\r\n",tempBuffer);
|
||||||
|
|
||||||
|
@ -236,6 +237,7 @@ static void drawPicture(void)
|
||||||
}
|
}
|
||||||
h_water_cnt = h_1 + h_2;
|
h_water_cnt = h_1 + h_2;
|
||||||
|
|
||||||
|
waterSpillSpotCount = max(v_water_cnt, h_water_cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read pixel data from MLX90640.
|
// Read pixel data from MLX90640.
|
||||||
|
@ -272,7 +274,7 @@ void blackOutFilter(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore edge of FOV
|
// ignore edge of FOV
|
||||||
waterSpillCount =0;
|
waterSpillLevel =0;
|
||||||
for (y=2; y<22; y++)
|
for (y=2; y<22; y++)
|
||||||
{
|
{
|
||||||
for (x=2; x<30; x++)
|
for (x=2; x<30; x++)
|
||||||
|
@ -299,7 +301,7 @@ void blackOutFilter(void)
|
||||||
if (blackOutTag == 0) {
|
if (blackOutTag == 0) {
|
||||||
|
|
||||||
zoneMask[y*32+x] ++;
|
zoneMask[y*32+x] ++;
|
||||||
waterSpillCount ++;
|
waterSpillLevel ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,6 +318,7 @@ void blackOutFilter(void)
|
||||||
}
|
}
|
||||||
void mlx90640_display_process(void)
|
void mlx90640_display_process(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
readTempValues();
|
readTempValues();
|
||||||
setTempScale();
|
setTempScale();
|
||||||
blackOutFilter();
|
blackOutFilter();
|
||||||
|
@ -336,7 +339,10 @@ void mlx90640_display_process(void)
|
||||||
// BSP_LCD_DisplayOff();
|
// BSP_LCD_DisplayOff();
|
||||||
}
|
}
|
||||||
|
|
||||||
//APP_LOG(TS_OFF, VLEVEL_L, "Water Spill Detected Level = %d of 600 \r\n", waterSpillCount);
|
if (waterSpillSpotCount != lastWaterSpillSpotCount) {
|
||||||
|
APP_LOG(TS_OFF, VLEVEL_L, "Water Spill Spot Detected Count = %2d Level = %d of 600 \r\n", waterSpillSpotCount,waterSpillLevel);
|
||||||
|
lastWaterSpillSpotCount = waterSpillSpotCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mlx90640_display_init(void){
|
void mlx90640_display_init(void){
|
||||||
|
|
Loading…
Reference in New Issue