tft.writeRect1BPP(75, 100, 16, 16, pict1bpp, palette);
tft.writeRect1BPP(320 - 90, 75, 16, 16, pict1bpp, palette);
palette[2] = ILI9488_MAROON;
palette[3] = ILI9488_PINK;
tft.writeRect2BPP(75, 125, 32, 16, pict2bpp, palette);
void ILI9488_t3::writeRect2BPP(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *pixels, const uint16_t * palette )
{
[COLOR="#FF0000"]#ifdef ENABLE_ILI9488_FRAMEBUFFER
if (_use_fbtft) {
writeRectNBPP(x, y, w, h, 2, pixels, palette);
return;
}
#endif[/COLOR]
beginSPITransaction();
setAddr(x, y, x+w-1, y+h-1);
writecommand_cont(ILI9488_RAMWR);
...
@mjs513... Forgot to ask, if you reading pixels is working on your display or not?
Will check it out - had a feeling you were going to go ahead and make the changeKurtE said:So I thought I would try My first pass (and maybe only pass) is that on T3.5/3.6 it always stays as 8 bits, but on T4, the library can be configured as either 8 bit or 16 bit... Currently too many places in .cpp file to make it easy to do on a sketch basis...
First pass: https://github.com/KurtE/ILI9488_t3/..._FB_non_pallet
Probably many issues... I have not tried it yet on T3.6... or configured the other way yet....
That's a great addon. Thanks. I want to fix up the constructor as well.Allow tft.begin() to now include an SPI Speed. Found it useful on ST7735.. And I was hitting some flakiness so ...
#include "SPI.h"
#include "ILI9488_t3.h"
#include "TouchScreen.h"
#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);
#define YP A18
#define XM A19
#define YM 5
#define XP 6
#define TS_MINX 120
#define TS_MINY 50
#define TS_MAXX 920
#define TS_MAXY 940
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
#define MINPRESSURE 10
#define MAXPRESSURE 1000
void setup(){
tft.begin();
tft.setRotation(3);
tft.fillScreen(ILI9488_BLACK);
tft.setTextColor(ILI9488_GREEN, ILI9488_BLACK); tft.setTextSize(3);
}
void loop(){
touchscreen();
}
void touchscreen(){
TSPoint p = ts.getPoint();
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
tft.setCursor(0,25);
tft.print("Z=");
tft.print(p.z);
tft.print(" ");
if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
tft.setCursor(0,0);
tft.print("X=");
tft.print(p.x);
tft.print(" ");
tft.setCursor(200,0);
tft.print("Y=");
tft.print(p.y);
tft.print(" ");
}
}
Remember, if you rotate the screen drawing with setRotation() you'll have to use map() or similar to flip around the X/Y coordinates for the touchscreen as well! It doesn't know about drawing rotation
#include "SPI.h"
#include "ILI9488_t3.h"
#include <Wire.h> // this is needed for FT6206
#include <Adafruit_FT6206.h>
#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);
#define TS_MINX 120
#define TS_MINY 50
#define TS_MAXX 920
#define TS_MAXY 940
// The FT6206 uses hardware I2C (SCL/SDA)
Adafruit_FT6206 ctp = Adafruit_FT6206();
#define MINPRESSURE 10
#define MAXPRESSURE 1000
void setup() {
tft.begin();
tft.setRotation(3);
tft.fillScreen(ILI9488_BLACK);
tft.setTextColor(ILI9488_GREEN, ILI9488_BLACK); tft.setTextSize(3);
if (! ctp.begin(40)) { // pass in 'sensitivity' coefficient
Serial.println("Couldn't start FT6206 touchscreen controller");
while (1);
}
}
void loop() {
touchscreen();
}
void touchscreen() {
if (! ctp.touched()) {
return;
}
// Retrieve a point
TS_Point p = ctp.getPoint();
tft.setCursor(0, 25);
tft.print("Z=");
tft.print(p.z);
tft.print(" ");
tft.setCursor(0, 0);
tft.print("X=");
tft.print(p.x);
tft.print(" ");
tft.setCursor(200, 0);
tft.print("Y=");
tft.print(p.y);
tft.print(" ");
}