From aefccf6d0372866931cb3c9a9d01d4a38be4e18a Mon Sep 17 00:00:00 2001 From: trav Date: Sat, 13 Aug 2022 16:53:14 -0400 Subject: [PATCH] scuttlebooth2 branch --- ._epd4in2.py | Bin 0 -> 4096 bytes epd4in2.py | 14 +++++++------- install/ebb-carousel.service | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 ._epd4in2.py diff --git a/._epd4in2.py b/._epd4in2.py new file mode 100644 index 0000000000000000000000000000000000000000..af15dedb4175e576053008098a302dfd6104c000 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVqjnu zg6Lp40#q)KrUhg=NL+w{K`J>vS1+-kASYEXC$YGsv^X^-C9xz`IUpFS=L(SKXJ8OV zs0&H0C~?h8&QHnAO9x7NG5kmZsePR;CkvuOL)>&NtPPD#j10{!ElfZ{qhK@yMnhmU z1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(1cU%1(2pPt267=8nZ*i4sm1xFMaiiOY57Ij u3YmE&sd*)t`FV*sIh6`Isc9t&NjZsm*}%RqRM(KEQ2h`0iVTC?|Nj78Ha2(w literal 0 HcmV?d00001 diff --git a/epd4in2.py b/epd4in2.py index 65b69fc..80b8cb1 100644 --- a/epd4in2.py +++ b/epd4in2.py @@ -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() diff --git a/install/ebb-carousel.service b/install/ebb-carousel.service index 48f26b7..a64fe8c 100644 --- a/install/ebb-carousel.service +++ b/install/ebb-carousel.service @@ -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