-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGFX_Image.ino
68 lines (58 loc) · 1.87 KB
/
GFX_Image.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
/*
* @Description: None
* @version: V1.0.0
* @Author: None
* @Date: 2023-07-25 13:45:02
* @LastEditors: LILYGO_L
* @LastEditTime: 2023-12-19 16:21:23
* @License: GPL 3.0
*/
#include <Arduino.h>
#include <Arduino_GFX_Library.h>
#include "pin_config.h"
#include "material_24Bit.h"
#include "T-Keyboard_S3_Drive.h"
/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_DataBus *bus = new Arduino_ESP32SPI(
N085_DC /* DC */, -1 /* CS */, N085_SCLK /* SCK */, N085_MOSI /* MOSI */, -1 /* MISO */); // Software SPI
/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
Arduino_GFX *gfx = new Arduino_GC9107(
bus, N085_RST /* RST */, 0 /* rotation */, true /* IPS */,
128 /* width */, 128 /* height */,
2 /* col offset 1 */, 1 /* row offset 1 */, 0 /* col_offset2 */, 0 /* row_offset2 */);
void setup(void)
{
pinMode(N085_BL, OUTPUT);
ledcAttachPin(N085_BL, 1); // assign TFT_BL pin to channel 1
ledcSetup(1, 20000, 8); // 12 kHz PWM, 8-bit resolution
ledcWrite(1, 255); // brightness 0 - 255
N085_Screen_Set(N085_Initialize);
N085_Screen_Set(N085_Screen_ALL);
gfx->begin();
gfx->fillScreen(BLACK);
N085_Screen_Set(N085_Screen_1);
gfx->draw24bitRGBBitmap(0, 0, gImage_1, 128, 128); // RGB
delay(1000);
N085_Screen_Set(N085_Screen_2);
gfx->draw24bitRGBBitmap(0, 0, gImage_2, 128, 128); // RGB
delay(1000);
N085_Screen_Set(N085_Screen_3);
gfx->draw24bitRGBBitmap(0, 0, gImage_3, 128, 128); // RGB
delay(1000);
N085_Screen_Set(N085_Screen_4);
gfx->draw24bitRGBBitmap(0, 0, gImage_4, 128, 128); // RGB
delay(1000);
}
void loop()
{
for (int i = 255; i > 0; i--)
{
ledcWrite(1, i);
delay(20);
}
for (int i = 0; i < 255; i++)
{
ledcWrite(1, i);
delay(20);
}
}