diff --git a/._epd4in2.py b/._epd4in2.py new file mode 100644 index 0000000..af15ded Binary files /dev/null and b/._epd4in2.py differ 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