-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharp_mlcd demo.py
More file actions
59 lines (46 loc) · 1.11 KB
/
Copy pathsharp_mlcd demo.py
File metadata and controls
59 lines (46 loc) · 1.11 KB
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
# sharp memory display driver demo code
# this code is intended for a 400*240 pixel display
#
# this module copyright: 2026 Peter Lumb
# licence: MIT
__version__ = "0.4.005"
__repo__ = "https://github.com/peter-l5/MicroPython-Sharp-Memory-Display"
print("starting test")
# from machine import Pin, I2C
from machine import Pin, SPI
import sharp_mlcd
print("dir sharp_mlcd: ", dir(sharp_mlcd))
import gc
import sys
import time
import framebuf
import array
# time.sleep(5)
# basic test code SPI
spi0 = SPI(0, baudrate=2_000_000, sck=Pin(18), mosi=Pin(19), miso=Pin(16))
print(spi0)
display = sharp_mlcd.SharpMemoryDisplay(
width=400, height=240, spi=spi0, cs=Pin(15, Pin.OUT)
)
print("display: ", dir(display))
display.clear()
print("display cleared")
time.sleep(2)
display.fill(0)
display.show()
print("display filled")
time.sleep(2)
display.fill(1)
display.show()
print("display filled")
time.sleep(2)
display.fill(0)
display.show()
print("display filled")
time.sleep(2)
display.text("SHARP MEMORY DISPLAY", 0, 0, 1)
display.text("driver", 0, 8, 1)
display.show(1, 16)
print("display filled")
time.sleep(3)
display.clear()