ESP8266 Overlap mode with touch screen #1474
Unanswered
sfxsfl
asked this question in
Q&A - Touch
Replies: 2 comments
-
See #1475 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
first of all. Thank you for the great piece of work and the effort you spend developing it.
I'm using the ESP8266 with an ili9341 with Touch in SPI Overlap mode.
In my simple sketch I'm using drawString within the setup and getTouch in loop. As a result
I'm getting artifacts on the screen at the last character.
`
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI(); // Invoke library
void setup(void) {
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_DARKGREY);
tft.setTextColor(TFT_WHITE,TFT_BLACK); tft.setTextSize(1);
// We can now plot text on screen using the "drawString"
tft.drawString("Welcome the ESP8266", 100, 110, 2);
}
void loop() {
uint16_t x,y;
#if 1
if (tft.getTouch(&x, &y)) {
delay(100);
}
#endif
delay(200);
}
UserSetup.h
#define ILI9341_DRIVER
#define TFT_SPI_ OVERLAP
#define TFT_CS PIN_D3
#define TFT_DC PIN_D1
#define TOUCH_CS PIN_D4 // Chip select pin (T_CS) of touch screen
#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
#define SPI_FREQUENCY 27000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000
// #define SPI_TOUCH_FREQUENCY 1000000
`
Thanks in advance
BR Stefan
Beta Was this translation helpful? Give feedback.
All reactions