@@ -37,24 +37,32 @@ Usage Example
37
37
from adafruit_epd.epd import Adafruit_EPD
38
38
from adafruit_epd.il0373 import Adafruit_IL0373
39
39
40
- # create the spi device and pins we will need
40
+ # create the spi device and pins we will need
41
41
spi = busio.SPI(board.SCK , MOSI = board.MOSI , MISO = board.MISO )
42
42
ecs = digitalio.DigitalInOut(board.D10)
43
43
dc = digitalio.DigitalInOut(board.D9)
44
44
srcs = digitalio.DigitalInOut(board.D8)
45
45
rst = digitalio.DigitalInOut(board.D7)
46
46
busy = digitalio.DigitalInOut(board.D6)
47
47
48
- # give them all to our driver
48
+ # give them all to our driver
49
49
display = Adafruit_IL0373(152 , 152 , rst, dc, busy, srcs, ecs, spi)
50
50
51
- # clear the buffer
51
+ # clear the buffer
52
52
display.clear_buffer()
53
53
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
58
66
59
67
display.display()
60
68
0 commit comments