-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGFX.ino
73 lines (58 loc) · 1.71 KB
/
GFX.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* @Description: GFX显示测试
* @version: V1.0.0
* @Author: LILYGO_L
* @Date: 2023-09-06 10:58:19
* @LastEditors: LILYGO_L
* @LastEditTime: 2024-05-28 14:16:01
* @License: GPL 3.0
*/
#include <Arduino.h>
#include "Arduino_GFX_Library.h"
#include "pin_config.h"
Arduino_DataBus *bus = new Arduino_ESP32QSPI(
LCD_CS /* CS */, LCD_SCLK /* SCK */, LCD_SDIO0 /* SDIO0 */, LCD_SDIO1 /* SDIO1 */,
LCD_SDIO2 /* SDIO2 */, LCD_SDIO3 /* SDIO3 */);
Arduino_GFX *gfx = new Arduino_CO5300(bus, LCD_RST /* RST */,
0 /* rotation */, false /* IPS */, LCD_WIDTH, LCD_HEIGHT,
20 /* col offset 1 */, 0 /* row offset 1 */, 0 /* col_offset2 */, 0 /* row_offset2 */);
void setup()
{
Serial.begin(115200);
Serial.println("Ciallo");
pinMode(LCD_EN, OUTPUT);
digitalWrite(LCD_EN, HIGH);
gfx->begin();
gfx->fillScreen(PINK);
for (int i = 0; i <= 255; i++)
{
gfx->Display_Brightness(i);
delay(3);
}
// for (int i = 0; i < 4; i++)
// {
// gfx->SetContrast(i);
// delay(2000);
// }
// gfx->SetContrast(0);
// gfx->fillScreen(RED);
// delay(1000);
// gfx->fillScreen(GREEN);
// delay(1000);
// gfx->fillScreen(BLUE);
// delay(1000);
gfx->drawRect(40, 40, 80, 80, RED);
gfx->drawFastVLine(80, 40, 80, PURPLE);
gfx->drawFastHLine(40, 80, 80, PURPLE);
gfx->drawPixel(50, 50, RED);
// gfx->fillRect(30, 30, 2, 2, RED);
gfx->setCursor(100, 100);
gfx->setTextColor(YELLOW);
gfx->println("Ciallo1~(L *##*L)^**");
gfx->drawRect(0, 0, LCD_WIDTH-1, LCD_HEIGHT-1, RED);
}
void loop()
{
// gfx->fillScreen(PINK);
// delay(1000);
}