scuttlebooth2 branch

This commit is contained in:
trav 2022-08-13 16:53:14 -04:00
parent bd70c3ef64
commit aefccf6d03
3 changed files with 8 additions and 8 deletions

BIN
._epd4in2.py Normal file

Binary file not shown.

View File

@ -227,8 +227,8 @@ class EPD:
return 0
def getbuffer(self, image):
# print "bufsiz = ",(self.width/8) * self.height
buf = [0xFF] * ((self.width/8) * self.height)
print ("bufsiz = ",(self.width/8) * self.height)
buf = [0xFF] * int(((self.width/8) * self.height))
image_monocolor = image.convert('1')
imwidth, imheight = image_monocolor.size
pixels = image_monocolor.load()
@ -247,25 +247,25 @@ class EPD:
newx = y
newy = self.height - x - 1
if pixels[x, y] == 0:
buf[(newx + newy*self.width) / 8] &= ~(0x80 >> (y % 8))
buf[int((newx + newy*self.width) / 8)] &= ~(0x80 >> (y % 8))
return buf
def display(self, image):
self.send_command(DATA_START_TRANSMISSION_1)
for i in range(0, self.width * self.height / 8):
for i in range(0, int(self.width * self.height / 8)):
self.send_data(0xFF)
self.send_command(DATA_START_TRANSMISSION_2)
for i in range(0, self.width * self.height / 8):
for i in range(0, int(self.width * self.height / 8)):
self.send_data(image[i])
self.send_command(DISPLAY_REFRESH)
self.wait_until_idle()
def Clear(self, color):
self.send_command(DATA_START_TRANSMISSION_1)
for i in range(0, self.width * self.height / 8):
for i in range(0, int(self.width * self.height / 8)):
self.send_data(0xFF)
self.send_command(DATA_START_TRANSMISSION_2)
for i in range(0, self.width * self.height / 8):
for i in range(0, int(self.width * self.height / 8)):
self.send_data(0xFF)
self.send_command(DISPLAY_REFRESH)
self.wait_until_idle()

View File

@ -3,7 +3,7 @@ Description=the EBB carousel
After=network.target
[Service]
ExecStart=/usr/bin/python -u carousel.py
ExecStart=/usr/bin/python3 -u carousel.py
WorkingDirectory=/home/pi/ebb
StandardOutput=inherit
StandardError=inherit