-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharp_demo.py
More file actions
54 lines (43 loc) · 1.04 KB
/
Copy pathsharp_demo.py
File metadata and controls
54 lines (43 loc) · 1.04 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
# 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__ = "v0.2.016"
__repo__ = "https://github.com/peter-l5/Sharp-Memory-Display"
print('starting test')
# from machine import Pin, I2C
from machine import Pin, SPI
import sharp
print('dir sharp: ', dir(sharp))
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.SharpMemoryDisplay(width=400, height=240, spi=spi0, cs=Pin(15, Pin.OUT))
print(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()
print("display filled")
time.sleep(3)