Add named logger
This commit is contained in:
parent
551b05e2f7
commit
2a10334edc
38 changed files with 286 additions and 208 deletions
|
|
@ -35,6 +35,8 @@ from . import epdconfig
|
|||
EPD_WIDTH = 600
|
||||
EPD_HEIGHT = 448
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class EPD:
|
||||
def __init__(self):
|
||||
self.reset_pin = epdconfig.RST_PIN
|
||||
|
|
@ -66,10 +68,10 @@ class EPD:
|
|||
epdconfig.digital_write(self.cs_pin, 1)
|
||||
|
||||
def ReadBusy(self):
|
||||
logging.debug("e-Paper busy")
|
||||
logger.debug("e-Paper busy")
|
||||
while(epdconfig.digital_read(self.busy_pin) == 0): # 0: idle, 1: busy
|
||||
epdconfig.delay_ms(100)
|
||||
logging.debug("e-Paper busy release")
|
||||
logger.debug("e-Paper busy release")
|
||||
|
||||
def init(self):
|
||||
if (epdconfig.module_init() != 0):
|
||||
|
|
@ -125,7 +127,7 @@ class EPD:
|
|||
image_monocolor = image.convert('1')
|
||||
imwidth, imheight = image_monocolor.size
|
||||
pixels = image_monocolor.load()
|
||||
logging.debug('imwidth = %d imheight = %d ',imwidth, imheight)
|
||||
logger.debug('imwidth = %d imheight = %d ',imwidth, imheight)
|
||||
if(imwidth == self.width and imheight == self.height):
|
||||
for y in range(imheight):
|
||||
for x in range(imwidth):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue