void Calibrate() { TFT_Set_Pen(CL_WHITE, 3); TFT_Set_Font(TFT_defaultFont, CL_WHITE, FO_HORIZONTAL); TFT_Write_Text("Touch selected corners for calibration", 50, 100); TFT_Line(315, 1, 319, 1); TFT_Line(310, 10, 319, 1); TFT_Line(319, 5, 319, 1); TFT_Write_Text("first here", 250, 20); TP_TFT_Calibrate_Min(); // Calibration of bottom left corner Delay_ms(500); TFT_Set_Pen(CL_BLACK, 3); TFT_Set_Font(TFT_defaultFont, CL_BLACK, FO_HORIZONTAL); TFT_Line(315, 1, 319, 1); TFT_Line(310, 10, 319, 1); TFT_Line(319, 5, 319, 1); TFT_Write_Text("first here", 250, 20); TFT_Set_Pen(CL_WHITE, 3); TFT_Set_Font(TFT_defaultFont, CL_WHITE, FO_HORIZONTAL); TFT_Line(0, 239, 0, 235); TFT_Line(0, 239, 5, 239); TFT_Line(0, 239, 10, 229); TFT_Write_Text("now here ", 15, 200); TP_TFT_Calibrate_Max(); // Calibration of bottom left corner Delay_ms(500); }
void Calibrate() { TFT_Set_Pen(CL_WHITE, 3); TFT_Set_Font(TFT_defaultFont, CL_WHITE, FO_HORIZONTAL); TFT_Write_Text("Touch selected corners for calibration", 50, 80); TFT_Write_Text("Touch selected corners for calibration", 50, 75); TFT_Line(315, 1, 319, 1); TFT_Line(310, 10, 319, 1); TFT_Line(319, 5, 319, 1); TFT_Write_Text("first here", 230, 20); TFT_Image(47, 90, logo_bmp, 1); /* DrawImage(&Image2); Image2.OwnerScreen = &Screen1; Image2.Order = 5; Image2.Left = 47; Image2.Top = 90; Image2.Width = 226; Image2.Height = 56; Image2.Picture_Type = 0; Image2.Picture_Ratio = 1; Image2.Picture_Name = logo_bmp; Image2.Visible = 1; Image2.Active = 1; Image2.OnUpPtr = 0; Image2.OnDownPtr = 0; Image2.OnClickPtr = 0; Image2.OnPressPtr = 0; */ TP_TFT_Calibrate_Min(); // Calibration of TP minimum Delay_ms(500); TFT_Set_Pen(CL_BLACK, 3); TFT_Set_Font(TFT_defaultFont, CL_BLACK, FO_HORIZONTAL); TFT_Line(315, 1, 319, 1); TFT_Line(310, 10, 319, 1); TFT_Line(319, 5, 319, 1); TFT_Write_Text("first here", 230, 20); TFT_Set_Pen(CL_WHITE, 3); TFT_Set_Font(TFT_defaultFont, CL_WHITE, FO_HORIZONTAL); TFT_Line(0, 239, 0, 235); TFT_Line(0, 239, 5, 239); TFT_Line(0, 239, 10, 230); TFT_Write_Text("now here ", 15, 200); TP_TFT_Calibrate_Max(); // Calibration of TP maximum Delay_ms(500); }
void Screen_init(void) { PenColor=1; shape=0; painted=0; TFT_Set_Default_Mode(); //TFT_Init_ILI9341_8bit(240,320); TFT_Init_ILI9341_8bit(320,240); ADC_Set_Input_Channel(_ADC_CHANNEL_8 | _ADC_CHANNEL_9); ADC1_Init(); TP_TFT_Init(320, 240, 8, 9); TP_TFT_Set_ADC_Threshold(600); TFT_Fill_Screen(colors[14]); TP_TFT_Calibrate_Min(); Delay_ms(500); TP_TFT_Calibrate_Max(); }