11/29/2023 0 Comments Seeed link it one v1.0a point object holds x y and z coordinates Tft.drawString(Button4_Name ,25, 237,2,Text_Color) Tft.fillRectangle(B4_X, B4_Y, B4_W, B4_H, Button_Background) Tft.drawRectangle(B4_X, B4_Y, B4_W, B4_H, Button_Color) Tft.drawString(Button3_Name ,25, 177,2,Text_Color) Tft.fillRectangle(B3_X, B3_Y, B3_W, B3_H, Button_Background) Tft.drawRectangle(B3_X, B3_Y, B3_W, B3_H, Button_Color) Tft.drawString(Button2_Name ,25, 117,2,Text_Color) Tft.fillRectangle(B2_X, B2_Y, B2_W, B2_H, Button_Background) Tft.drawRectangle(B2_X, B2_Y, B2_W, B2_H, Button_Color) Tft.drawString(Button1_Name ,25, 57,2,Text_Color) Tft.fillRectangle(B1_X, B1_Y, B1_W, B1_H, Button_Background) Tft.drawRectangle(B1_X, B1_Y, B1_W, B1_H, Button_Color) Page = 1 Tft.fillRectangle(0, 0, 240, 320, Background_Color) TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300) The 2.8" TFT Touch shield has 300 ohms across the X plate between X+ and X- Use any multimeter to read it For better pressure precision, we need to know the resistance TS_MAXY corresponds to ADC value when Y = 320 -1 define TS_MINX 118 define TS_MAXX 922 define TS_MINY 71 define TS_MAXY 949 TS_MAXX corresponds to ADC value when X = 240 -1 TS_MINY corresponds to ADC value when Y = 0 TS_MINX corresponds to ADC value when X = 0 #define XP 57 // can be a digital pin, this is A3 #define YM 54 // can be a digital pin, this is A0 #define XP 17 // can be a digital pin, this is A3Įndif ifdef MEGA #define YP A2 // must be an analog pin, use "An" notation! #define YM 14 // can be a digital pin, this is A0 #define XM A1 // must be an analog pin, use "An" notation! When I get home I'll see how I got it working and let you know.Įdit: I'll format the code later, but this is a blink program for that panel include include include ifdef SEEEDUINO #define YP A2 // must be an analog pin, use "An" notation! I was just using one of these, I am a few hours from home.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |