Skip to content

Commit 9108c00

Browse files
committed
DM: update readme example
1 parent 6acd0c0 commit 9108c00

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,32 @@ Usage Example
3737
from adafruit_epd.epd import Adafruit_EPD
3838
from adafruit_epd.il0373 import Adafruit_IL0373
3939
40-
#create the spi device and pins we will need
40+
# create the spi device and pins we will need
4141
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
4242
ecs = digitalio.DigitalInOut(board.D10)
4343
dc = digitalio.DigitalInOut(board.D9)
4444
srcs = digitalio.DigitalInOut(board.D8)
4545
rst = digitalio.DigitalInOut(board.D7)
4646
busy = digitalio.DigitalInOut(board.D6)
4747
48-
#give them all to our driver
48+
# give them all to our driver
4949
display = Adafruit_IL0373(152, 152, rst, dc, busy, srcs, ecs, spi)
5050
51-
#clear the buffer
51+
# clear the buffer
5252
display.clear_buffer()
5353
54-
#draw some arbitrary lines and shapes!!
55-
display.fill_rect(30, 20, 50, 60, Adafruit_EPD.RED)
56-
display.hline(120, 30, 60, Adafruit_EPD.BLACK)
57-
display.vline(120, 30, 60, Adafruit_EPD.BLACK)
54+
r_width = 5
55+
r_pos = display.height
56+
57+
#draw some rectangles!
58+
color = Adafruit_EPD.BLACK
59+
while r_pos > display.height/2:
60+
if r_pos < display.height - 50:
61+
color = Adafruit_EPD.RED
62+
display.rect(display.width - r_pos, display.height - r_pos,
63+
display.width - 2*(display.width - r_pos),
64+
display.height - 2*(display.height - r_pos), color)
65+
r_pos = r_pos - r_width
5866
5967
display.display()
6068

0 commit comments

Comments
 (0)