aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD. Delmar Davis <don@suspectdevices.com>2021-04-09 13:02:56 -0700
committerD. Delmar Davis <don@suspectdevices.com>2021-04-09 13:02:56 -0700
commit62493a9f2bcac8f1405964b4807bbfdb2dc86d42 (patch)
tree39d0a31c007fe348614ed6776061882936db8f4d
parentad7e1f704893fefb64e77a8b828e4715c0bfa33d (diff)
works better for me
-rw-r--r--worksforme.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/worksforme.py b/worksforme.py
index 86cbfdf..b19fbe5 100644
--- a/worksforme.py
+++ b/worksforme.py
@@ -10,8 +10,8 @@ from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from adafruit_epd.epd import Adafruit_EPD
-#from adafruit_epd.ssd1675b import Adafruit_SSD1675B # pylint: disable=unused-import
-from adafruit_epd.ssd1675 import Adafruit_SSD1675 # pylint: disable=unused-import
+from adafruit_epd.ssd1675b import Adafruit_SSD1675B # pylint: disable=unused-import
+#from adafruit_epd.ssd1675 import Adafruit_SSD1675 # pylint: disable=unused-import
# create two buttons
switch1 = DigitalInOut(board.D6)
@@ -27,7 +27,7 @@ rst = DigitalInOut(board.D27)
busy = DigitalInOut(board.D17)
# give them all to our driver
-display = Adafruit_SSD1675(
+display = Adafruit_SSD1675B(
122,
250,
spi, # 2.13" HD mono display (rev B)
@@ -47,7 +47,7 @@ image = Image.new("RGB", (width, height))
WHITE = (0xFF, 0xFF, 0xFF)
BLACK = (0x00, 0x00, 0x00)
-
+print("clearing display")
# clear the buffer
display.fill(Adafruit_EPD.WHITE)
# clear it out
@@ -57,6 +57,7 @@ display.display()
draw = ImageDraw.Draw(image)
# empty it
draw.rectangle((0, 0, width, height), fill=WHITE)
+print("drawing box")
# Draw an outline box
draw.rectangle((1, 1, width - 2, height - 2), outline=BLACK, fill=WHITE)
@@ -68,6 +69,7 @@ top = padding
bottom = height - padding
# Move left to right keeping track of the current x position for drawing shapes.
x = padding
+"""
# Draw an ellipse.
draw.ellipse((x, top, x + shape_width, bottom), outline=WHITE, fill=BLACK)
x += shape_width + padding
@@ -85,6 +87,7 @@ x += shape_width + padding
draw.line((x, bottom, x + shape_width, top), fill=BLACK)
draw.line((x, top, x + shape_width, bottom), fill=BLACK)
x += shape_width + padding
+"""
# Load default font.
font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 20)
@@ -97,6 +100,7 @@ font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 20)
# Write two lines of text.
draw.text((x, top), "Goodbye", font=font, fill=BLACK)
draw.text((x, top + 20), "World!", font=font, fill=BLACK)
+print("entering the loops")
while True:
if not switch1.value:
@@ -104,11 +108,11 @@ while True:
display.image(image)
display.display()
while not switch1.value:
- time.sleep(0.01)
+ time.sleep(0.001)
if not switch2.value:
print("Switch 2")
display.fill(Adafruit_EPD.WHITE)
display.display()
while not switch2.value:
- time.sleep(0.01)
- time.sleep(0.01)
+ time.sleep(0.001)
+ time.sleep(0.001)