Skip to content

Commit 79d2313

Browse files
committed
feat(steami_screen): add example of smileys
1 parent d2ec9ef commit 79d2313

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
"""
2+
Cycle through all 6 built-in face expressions.
3+
"""
4+
5+
from time import sleep_ms
6+
7+
import ssd1327
8+
from machine import SPI, Pin
9+
from steami_screen import Screen, SSD1327Display
10+
11+
# --- Display setup ---
12+
spi = SPI(1)
13+
dc = Pin("DATA_COMMAND_DISPLAY")
14+
res = Pin("RST_DISPLAY")
15+
cs = Pin("CS_DISPLAY")
16+
17+
raw_display = ssd1327.WS_OLED_128X128_SPI(spi, dc, res, cs)
18+
display = SSD1327Display(raw_display)
19+
screen = Screen(display)
20+
21+
faces = [
22+
("happy", "HAPPY"),
23+
("sad", "SAD"),
24+
("surprised", "SURPRISED"),
25+
("sleeping", "SLEEPING"),
26+
("angry", "ANGRY"),
27+
("love", "LOVE"),
28+
]
29+
30+
compact = True
31+
32+
while True:
33+
compact = not compact
34+
for expression, label in faces:
35+
screen.clear()
36+
screen.face(expression, compact=compact)
37+
screen.show()
38+
print("Showing face:", label, "Compact:", compact)
39+
sleep_ms(1000)

0 commit comments

Comments
 (0)