mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Merge pull request #192 from wlmh110/master
waveshare e-lnk 2.13 V3/V4 update
This commit is contained in:
@ -2,6 +2,7 @@ import logging
|
|||||||
|
|
||||||
import pwnagotchi.ui.fonts as fonts
|
import pwnagotchi.ui.fonts as fonts
|
||||||
from pwnagotchi.ui.hw.base import DisplayImpl
|
from pwnagotchi.ui.hw.base import DisplayImpl
|
||||||
|
from PIL import Image,ImageDraw,ImageFont
|
||||||
|
|
||||||
|
|
||||||
class WaveshareV3(DisplayImpl):
|
class WaveshareV3(DisplayImpl):
|
||||||
@ -37,6 +38,14 @@ class WaveshareV3(DisplayImpl):
|
|||||||
self._display = EPD()
|
self._display = EPD()
|
||||||
self._display.init()
|
self._display.init()
|
||||||
self._display.Clear(0xFF)
|
self._display.Clear(0xFF)
|
||||||
|
try:
|
||||||
|
new_image = Image.new('1', ( self._display.height, self._display.width), 255)
|
||||||
|
buf = self._display.getbuffer(new_image)
|
||||||
|
self._display.displayPartBaseImage(buf)
|
||||||
|
except Exception as e:
|
||||||
|
logging.info(e)
|
||||||
|
|
||||||
|
logging.info("initializing waveshare v3 display done")
|
||||||
|
|
||||||
def render(self, canvas):
|
def render(self, canvas):
|
||||||
buf = self._display.getbuffer(canvas)
|
buf = self._display.getbuffer(canvas)
|
||||||
|
@ -3,6 +3,7 @@ import logging
|
|||||||
import pwnagotchi.ui.fonts as fonts
|
import pwnagotchi.ui.fonts as fonts
|
||||||
from pwnagotchi.ui.hw.base import DisplayImpl
|
from pwnagotchi.ui.hw.base import DisplayImpl
|
||||||
|
|
||||||
|
from PIL import Image,ImageDraw,ImageFont
|
||||||
|
|
||||||
class WaveshareV4(DisplayImpl):
|
class WaveshareV4(DisplayImpl):
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
@ -36,6 +37,14 @@ class WaveshareV4(DisplayImpl):
|
|||||||
self._display = EPD()
|
self._display = EPD()
|
||||||
self._display.init()
|
self._display.init()
|
||||||
self._display.Clear(0xFF)
|
self._display.Clear(0xFF)
|
||||||
|
try:
|
||||||
|
new_image = Image.new('1', ( self._display.height, self._display.width), 255)
|
||||||
|
buf = self._display.getbuffer(new_image)
|
||||||
|
self._display.displayPartBaseImage(buf)
|
||||||
|
except Exception as e:
|
||||||
|
logging.info(e)
|
||||||
|
|
||||||
|
logging.info("initializing waveshare v2in13_V4 display done")
|
||||||
|
|
||||||
def render(self, canvas):
|
def render(self, canvas):
|
||||||
buf = self._display.getbuffer(canvas)
|
buf = self._display.getbuffer(canvas)
|
||||||
|
Reference in New Issue
Block a user