Compare commits
No commits in common. "ada71de487ad300ea389bbe085b149f7759d517a" and "82196a9168e62c62aeb8481266bfa88c87b02455" have entirely different histories.
ada71de487
...
82196a9168
|
@ -1,3 +0,0 @@
|
||||||
[submodule "lib/e-Paper"]
|
|
||||||
path = lib/e-Paper
|
|
||||||
url = git://github.com/waveshare/e-Paper.git
|
|
46
display.py
46
display.py
|
@ -1,46 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import logging
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
libdir = "./lib/e-Paper/RaspberryPi_JetsonNano/python/lib"
|
|
||||||
if os.path.exists(libdir):
|
|
||||||
sys.path.append(libdir)
|
|
||||||
from waveshare_epd import epd7in5_V2 as epd7in5
|
|
||||||
|
|
||||||
# Ref https://github.com/waveshareteam/e-Paper/blob/master/RaspberryPi_JetsonNano/python/examples/epd_7in5_V2_test.py
|
|
||||||
|
|
||||||
def main():
|
|
||||||
try:
|
|
||||||
epd = epd7in5.EPD()
|
|
||||||
logging.debug("Initializing e-Paper display")
|
|
||||||
epd.init()
|
|
||||||
|
|
||||||
# Get the file_name from command-line arguments
|
|
||||||
file_name = sys.argv[1]
|
|
||||||
|
|
||||||
logging.debug(f"Reading image file: {file_name}")
|
|
||||||
Himage = Image.open(file_name)
|
|
||||||
logging.debug("Displaying image on screen")
|
|
||||||
epd.display(epd.getbuffer(Himage))
|
|
||||||
|
|
||||||
# Put the display to sleep
|
|
||||||
epd.sleep()
|
|
||||||
logging.debug("Putting display to sleep")
|
|
||||||
|
|
||||||
# Clean up resources
|
|
||||||
epd.Dev_exit()
|
|
||||||
logging.debug("Exiting")
|
|
||||||
|
|
||||||
except IOError as e:
|
|
||||||
logging.exception("IOError occurred: " + str(e))
|
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
logging.debug("Keyboard Interrupt - Exiting")
|
|
||||||
epd7in5.epdconfig.module_exit()
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
||||||
main()
|
|
Loading…
Reference in New Issue