@@ -25,26 +25,27 @@ For images in the `dat` format, make sure that they do not exceed the screen dis
25
25
26
26
### Example Code
27
27
``` python
28
- # This is an example of usage
28
+ # 这是一个使用示例 This is an example of usage
29
29
import time
30
30
import framebuf
31
31
from machine import SPI , Pin
32
- from drivers import st7735_buf
33
- from libs .easydisplay import EasyDisplay
32
+ from driver import st7735_buf
33
+ from lib .easydisplay import EasyDisplay
34
34
35
- # ESP32C3 & ST7735
36
- spi = SPI(1 , baudrate = 20000000 , polarity = 0 , phase = 0 , sck = Pin(19 ), mosi = Pin(18 ))
37
- dp = st7735_buf.ST7735(width = 160 , height = 128 , spi = spi, cs = 0 , dc = 1 , rst = 11 , rotation = 1 )
38
- ed = EasyDisplay(display = dp, font = " /text_lite_16px_2311 .v3.bmf" , show = True , color = 0x FFFF , clear = True ,
39
- color_type = framebuf. RGB565 , auto_wrap = True )
35
+ # ESP32S3 & ST7735
36
+ spi = SPI(1 , baudrate = 20000000 , polarity = 0 , phase = 0 , sck = Pin(18 ), mosi = Pin(17 ))
37
+ dp = st7735_buf.ST7735(width = 128 , height = 128 , spi = spi, cs = 14 , dc = 15 , res = 16 , rotate = 1 , bl = 13 , invert = False , rgb = False )
38
+ ed = EasyDisplay(display = dp, font = " /text_lite_16px_2312 .v3.bmf" , show = True , color = 0x FFFF , clear = True ,
39
+ color_type = " RGB565" )
40
40
41
41
ed.bmp(" /img/test.bmp" , 0 , 0 )
42
42
time.sleep(3 )
43
- ed.pbm(" /img/test.pbm" , 0 , 0 , color_type = framebuf. MONO_HLSB )
43
+ ed.pbm(" /img/test.pbm" , 0 , 0 , color_type = " MONO " )
44
44
time.sleep(3 )
45
45
ed.text(" 你好,世界!\n Hello World!\n こんにちは、世界!" , 0 , 0 )
46
46
47
- # For more advanced usage, please refer to the source code comments: /libs/easydisplay.py
47
+ # 更多高级使用方式详见源码注释:/lib/easydisplay.py
48
+ # For more advanced usage, please refer to the source code comments: /lib/easydisplay.py
48
49
```
49
50
50
51
### Special Thanks
0 commit comments