-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclear_display.py
More file actions
40 lines (32 loc) · 1.01 KB
/
Copy pathclear_display.py
File metadata and controls
40 lines (32 loc) · 1.01 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
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
Simple script to clear the e-ink display
"""
import sys
import os
import time
# Setup paths like in the test file
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
from unified_epd_adapter import UnifiedEPD, EPDConfig
def clear_display():
"""Clear the e-ink display"""
try:
print("🖥️ Initializing e-ink display...")
display_type = EPDConfig.load_display_config()
epd = UnifiedEPD.create_display(display_type)
epd.init()
print("🧹 Clearing display...")
epd.clear()
print("💤 Putting display to sleep...")
epd.sleep()
print("✅ Display cleared successfully!")
except Exception as e:
print(f"❌ Error clearing display: {e}")
sys.exit(1)
if __name__ == "__main__":
print("E-ink Display Clear Script")
print("=" * 30)
clear_display()