33 Serial.println(
"ILI9341 Test!");
39 Serial.print(
"Display Power Mode: 0x");
40 Serial.println(x, HEX);
42 Serial.print(
"MADCTL Mode: 0x");
43 Serial.println(x, HEX);
45 Serial.print(
"Pixel Format: 0x");
46 Serial.println(x, HEX);
48 Serial.print(
"Image Format: 0x");
49 Serial.println(x, HEX);
51 Serial.print(
"Self Diagnostic: 0x");
52 Serial.println(x, HEX);
54 Serial.println(F(
"Benchmark Time (microseconds)"));
56 Serial.print(F(
"Screen fill "));
60 Serial.print(F(
"Text "));
64 Serial.print(F(
"Lines "));
68 Serial.print(F(
"Horiz/Vert Lines "));
72 Serial.print(F(
"Rectangles (outline) "));
76 Serial.print(F(
"Rectangles (filled) "));
80 Serial.print(F(
"Circles (filled) "));
83 Serial.print(F(
"Circles (outline) "));
87 Serial.print(F(
"Triangles (outline) "));
91 Serial.print(F(
"Triangles (filled) "));
95 Serial.print(F(
"Rounded rects (outline) "));
99 Serial.print(F(
"Rounded rects (filled) "));
103 Serial.println(F(
"Done!"));
110 for (uint8_t rotation=0; rotation<4; rotation++)
120 unsigned long start = micros();
131 return micros() -
start;
137 unsigned long start = micros();
141 tft.println(
"Hello World!");
144 tft.println(1234.56);
147 tft.println(0xDEADBEEF, HEX);
151 tft.println(
"Groop");
153 tft.println(
"I implore thee,");
155 tft.println(
"my foonting turlingdromes.");
156 tft.println(
"And hooptiously drangle me");
157 tft.println(
"with crinkly bindlewurdles,");
158 tft.println(
"Or I will rend thee");
159 tft.println(
"in the gobberwarts");
160 tft.println(
"with my blurglecruncheon,");
161 tft.println(
"see if I don't!");
162 return micros() -
start;
167 unsigned long start, t;
178 for (x2=0; x2<w; x2+=6) tft.
drawLine(x1, y1, x2, y2, color);
180 for (y2=0; y2<h; y2+=6) tft.
drawLine(x1, y1, x2, y2, color);
181 t = micros() -
start;
191 for (x2=0; x2<w; x2+=6) tft.
drawLine(x1, y1, x2, y2, color);
193 for (y2=0; y2<h; y2+=6) tft.
drawLine(x1, y1, x2, y2, color);
194 t += micros() -
start;
204 for (x2=0; x2<w; x2+=6) tft.
drawLine(x1, y1, x2, y2, color);
206 for (y2=0; y2<h; y2+=6) tft.
drawLine(x1, y1, x2, y2, color);
207 t += micros() -
start;
217 for (x2=0; x2<w; x2+=6) tft.
drawLine(x1, y1, x2, y2, color);
219 for (y2=0; y2<h; y2+=6) tft.
drawLine(x1, y1, x2, y2, color);
222 return micros() -
start;
235 return micros() -
start;
242 cx = tft.
width() / 2,
251 tft.
drawRect(cx-i2, cy-i2, i, i, color);
254 return micros() -
start;
259 unsigned long start, t = 0;
261 cx = tft.
width() / 2 - 1,
262 cy = tft.
height() / 2 - 1;
270 tft.
fillRect(cx-i2, cy-i2, i, i, color1);
271 t += micros() -
start;
273 tft.
drawRect(cx-i2, cy-i2, i, i, color2);
283 int x, y, w = tft.
width(), h = tft.
height(), r2 = radius * 2;
287 for (x=radius; x<w; x+=r2)
289 for (y=radius; y<h; y+=r2)
295 return micros() -
start;
301 int x, y, r2 = radius * 2,
302 w = tft.
width() + radius,
303 h = tft.
height() + radius;
308 for (x=0; x<w; x+=r2)
310 for (y=0; y<h; y+=r2)
316 return micros() -
start;
322 int n,
i, cx = tft.
width() / 2 - 1,
323 cy = tft.
height() / 2 - 1;
337 return micros() -
start;
342 unsigned long start, t = 0;
343 int i, cx = tft.
width() / 2 - 1,
344 cy = tft.
height() / 2 - 1;
348 for (i=
min(cx,cy); i>10; i-=5)
351 tft.
fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
353 t += micros() -
start;
354 tft.
drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
366 cx = tft.
width() / 2 - 1,
367 cy = tft.
height() / 2 - 1;
378 return micros() -
start;
385 cx = tft.
width() / 2 - 1,
386 cy = tft.
height() / 2 - 1;
397 return micros() -
start;
unsigned long testCircles(uint8_t radius, uint16_t color)
virtual void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
int16_t height(void) const
unsigned long testTriangles()
unsigned long testFillScreen()
void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
uint16_t color565(uint8_t r, uint8_t g, uint8_t b)
void setCursor(int16_t x, int16_t y)
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
int16_t width(void) const
void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
uint8_t readcommand8(uint8_t reg, uint8_t index=0)
unsigned long testRoundRects()
void setTextColor(uint16_t c)
void setRotation(uint8_t r)
unsigned long testFilledTriangles()
unsigned long testFilledCircles(uint8_t radius, uint16_t color)
virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
unsigned long testFilledRoundRects()
void fillScreen(uint16_t color)
unsigned long testRects(uint16_t color)
void setTextSize(uint8_t s)
unsigned long testFilledRects(uint16_t color1, uint16_t color2)
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
#define ILI9341_RDSELFDIAG
unsigned long testLines(uint16_t color)
unsigned long testFastLines(uint16_t color1, uint16_t color2)