Fixed touch & Improved display
This commit is contained in:
		@@ -21,8 +21,8 @@ void Display::setup(){
 | 
			
		||||
    Paint_SetMirroring(MIRROR_HORIZONTAL);
 | 
			
		||||
    Paint_Clear(WHITE);
 | 
			
		||||
 | 
			
		||||
    Paint_DrawIcon(89,54, ICON_LOGO, &FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawString_EN(29, 5, "Helcel", &Font45, WHITE, BLACK);
 | 
			
		||||
    Paint_DrawIcon(89,36, ICON_LOGO, &FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawString_EN(29, 0, "Helcel", &Font45, WHITE, BLACK);
 | 
			
		||||
    Paint_SelectImage(BlackImage);
 | 
			
		||||
    EPD_2IN13_V2_Display(BlackImage);
 | 
			
		||||
    delay(100);
 | 
			
		||||
@@ -102,24 +102,56 @@ void WeatherDisplay::drawDisplay() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TempDisplay::drawDisplay() { 
 | 
			
		||||
    Paint_DrawIcon(0,Font24.Height, ICON_TEMPERATURE,&FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawString_EN(2,0,"Temp", &Font24, WHITE, BLACK);
 | 
			
		||||
    Paint_DrawFltUnit(76,0,sensor->heatidx, "C", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(76,36,sensor->temp, "C", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(160,36,sensor->hum, "%", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(76,64,sensor->pres, "hPa", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIcon(0,8, ICON_TEMPERATURE,&FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(76,0,sensor->temp, "C", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(186,6,sensor->heatidx, "C", &Font12, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(76,24,sensor->pres, "hPa", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(76,48,sensor->hum, "%", &Font24, BLACK, WHITE);
 | 
			
		||||
 | 
			
		||||
    Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - 4 - Font16.Height,"nominal", &Font16, WHITE, BLACK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AirDisplay::drawDisplay() { 
 | 
			
		||||
    Paint_DrawIcon(0,Font24.Height, ICON_POLUTION,&FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawString_EN(2,0,"Air", &Font24, WHITE, BLACK);
 | 
			
		||||
    Paint_DrawIntUnit(150,10, 69,"", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIcon(0,8, ICON_POLUTION,&FontIcon, BLACK, WHITE);
 | 
			
		||||
 | 
			
		||||
    Paint_DrawIntUnit(76,0,sensor->voci, "voci", &Font24, BLACK, WHITE);
 | 
			
		||||
 | 
			
		||||
    Paint_DrawIntUnit(76,24+12*0,sensor->pmd.pm10_standard, "ug/m3", &Font12, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIntUnit(76,24+12*1,sensor->pmd.pm25_standard, "ug/m3", &Font12, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIntUnit(76,24+12*2,sensor->pmd.pm100_standard, "ug/m3", &Font12, BLACK, WHITE);
 | 
			
		||||
 | 
			
		||||
    Paint_DrawIntUnit(186,24+12*0,sensor->pmd.pm10_env, "ug/m3", &Font12, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIntUnit(186,24+12*1,sensor->pmd.pm25_env, "ug/m3", &Font12, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIntUnit(186,24+12*2,sensor->pmd.pm100_env, "ug/m3", &Font12, BLACK, WHITE);
 | 
			
		||||
 | 
			
		||||
//       particles_03um,      ///< 0.3um Particle Count
 | 
			
		||||
//       particles_05um,      ///< 0.5um Particle Count
 | 
			
		||||
//       particles_10um,      ///< 1.0um Particle Count
 | 
			
		||||
//       particles_25um,      ///< 2.5um Particle Count
 | 
			
		||||
//       particles_50um,      ///< 5.0um Particle Count
 | 
			
		||||
//       particles_100um;     ///< 10.0um Particle Count
 | 
			
		||||
 | 
			
		||||
  Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - 4 - Font16.Height,"nominal", &Font16, WHITE, BLACK);
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void LightDisplay::drawDisplay() { 
 | 
			
		||||
    Paint_DrawIcon(0,8, ICON_BULB,&FontIcon, BLACK, WHITE); //TODO BULB
 | 
			
		||||
 | 
			
		||||
    Paint_DrawFltUnit(76,0,sensor->light_lux, "lux", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIntUnit(76,24*1,sensor->uvi, "uvi", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawFltUnit(76,24*2,sensor->light, "l", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIntUnit(76,24*3,sensor->light_vis, "vl", &Font24, BLACK, WHITE);
 | 
			
		||||
 | 
			
		||||
    Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - 4 - Font16.Height,"nominal", &Font16, WHITE, BLACK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void MainDisplay::drawDisplay() { 
 | 
			
		||||
    Paint_DrawIcon(0,0, ICON_LOGO,&FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawString_EN(60,0,"MAIN", &Font24, WHITE, BLACK);
 | 
			
		||||
    Paint_DrawIntUnit(0,30, 69,"", &Font24, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawIcon(89,36, ICON_LOGO, &FontIcon, BLACK, WHITE);
 | 
			
		||||
    Paint_DrawString_EN(29, 0, "Helcel", &Font45, WHITE, BLACK);
 | 
			
		||||
    Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - 4 - Font16.Height,"WESP-v0.1", &Font16, WHITE, BLACK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CustomDisplay::drawDisplay() { 
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,14 @@ class AirDisplay: public DisplayWrapper {
 | 
			
		||||
        Sensor* sensor;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class LightDisplay: public DisplayWrapper {
 | 
			
		||||
    public:
 | 
			
		||||
        LightDisplay(Sensor* s) : sensor(s){}
 | 
			
		||||
        void drawDisplay();
 | 
			
		||||
    private:
 | 
			
		||||
        Sensor* sensor;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class MainDisplay: public DisplayWrapper {
 | 
			
		||||
    public:
 | 
			
		||||
        void drawDisplay();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user