Skip to content

Instantly share code, notes, and snippets.

@margyle
Created July 26, 2019 12:42
Show Gist options
  • Save margyle/27baa858922c6cc33dd9bd6b53cc2bb6 to your computer and use it in GitHub Desktop.
Save margyle/27baa858922c6cc33dd9bd6b53cc2bb6 to your computer and use it in GitHub Desktop.

Revisions

  1. margyle created this gist Jul 26, 2019.
    25 changes: 25 additions & 0 deletions einkDemo.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/usr/bin/python
    # -*- coding:utf-8 -*-

    import epd2in7b
    import time
    from PIL import Image,ImageDraw,ImageFont
    import traceback

    try:
    epd = epd2in7b.EPD()
    epd.init()
    print("Clear...")
    epd.Clear(0xFF)

    print("read bmp file")
    HBlackimage = Image.open('flowerR.bmp')
    HRedimage = Image.open('flowerB.bmp')
    epd.display(epd.getbuffer(HRedimage),epd.getbuffer(HBlackimage))
    time.sleep(30)

    epd.sleep()

    except :
    print ('traceback.format_exc():\n%s',traceback.format_exc())
    exit()