Skip to content

Commit 39bf20e

Browse files
authored
Added display Reference documentation
1 parent 3c1fdc6 commit 39bf20e

File tree

1 file changed

+107
-1
lines changed

1 file changed

+107
-1
lines changed

docs/readme.md

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,112 @@ The resolution is 240 x 240.
285285

286286
Initialized inside the main `begin()`
287287

288-
You can find the library documentation from Adafruit to draw [here](https://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives)
288+
Colors : every color with the prefix ‘ST77XX_’ i.e. ST77XX_BLACK. Colors available from the library are BLACK, WHITE, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, ORANGE
289+
290+
In order to turn on the screen you will need to add this inside the setup()
291+
(already inside the main begin())
292+
display.init(240, 240);
293+
pinMode(TFT_BLACKLIGHT, OUTPUT);
294+
digitalWrite(TFT_BLACKLIGHT,HIGH);
289295

290296
Colors : every color with the prefix ‘ST77XX_’ i.e. ST77XX_BLACK. Colors available from the library are BLACK, WHITE, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, ORANGE
297+
298+
#### General:
299+
300+
Fill the entire screen with the selected color
301+
```cpp
302+
display.fillScreen(color)
303+
```
304+
305+
Get width and height
306+
```cpp
307+
display.width() / height()
308+
```
309+
310+
Rotates the coordinate system (number between 0 and 3)
311+
```cpp
312+
display.setRotation(0-3)
313+
```
314+
315+
#### Text:
316+
Set the cursor to write text in the selected pixels
317+
```cpp
318+
display.setCursor(screenX, screenY)
319+
```
320+
321+
```cpp
322+
display.print(text)
323+
```
324+
It will print the string inside in the current cursor position
325+
326+
```cpp
327+
display.setTextColor(color)
328+
```
329+
Saves the selected color to print the text until the color is changed again
330+
331+
```cpp
332+
display.setTextSize(size)
333+
```
334+
Sets the size of the text that is gonna be printed
335+
336+
```cpp
337+
display.setTextWrap(True/False)
338+
```
339+
Set the auto wrap of the text, if it is not the text will not jump to the next line.
340+
341+
####Drawings:
342+
Draw a Line from the start Vector to the End vector with the selected color, Use drawFastVLine() and drawFastHLine() introducing the same settings, to avoid the agular calc.
343+
```cpp
344+
display.drawLine(startX, startY, endX, endY, color)
345+
```
346+
347+
Draw a Circle from the center Vector with the selected radius and color
348+
```cpp
349+
display.drawCircle(centerX, centerY, radius, color)
350+
```
351+
352+
Draw a rectangle
353+
```cpp
354+
display.drawRect(topLeftX, topLeftY, width, height, color)
355+
```
356+
357+
Draw a filled rectangle
358+
```cpp
359+
display.fillRect(topLeftX, topLeftY, width, height, color)
360+
```
361+
362+
Draw a filled circle from the center Vector, with the selected radius and color
363+
```cpp
364+
display.fillCircle(centerX, centerY, radius, color)
365+
```
366+
367+
Draw a rounded rectangle
368+
```cpp
369+
display.drawRoundRect(topLeftX, topLeftY, width, height, curveRadius, color)
370+
```
371+
372+
Draw a filled and rounded rectangle
373+
```cpp
374+
display.fillRoundRect(topLeftX, topLeftY, width, height, curveRadius, color)
375+
```
376+
377+
Draw a triangle by introducing the 3 points and color
378+
```cpp
379+
display.drawTriangle(x0, y0, x1, y1, x2, y2, color)
380+
```
381+
382+
Draw a filled triangle
383+
```cpp
384+
display.fillTriangle(x0, y0, x1, y1, x2, y2, color)
385+
```
386+
387+
Draw a character
388+
```cpp
389+
display.drawChar(topLeftX, topLeftY, character, color, backgroundColor, size)
390+
```
391+
392+
Draw a bitmap, the bitmap needs to be with PROGMEM
393+
```cpp
394+
display.drawBitmap(startX, startY, bitmap, width, height, color)
395+
```
396+

0 commit comments

Comments
 (0)