Skip to content

Commit 0bd2147

Browse files
committed
.
1 parent 50d510a commit 0bd2147

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ https://docs.circuitpython.org/projects/framebuf/en/latest/ and https://github.c
3131
from epd_2in13_b import EPD_2in13_B
3232

3333
try:
34-
#initialise class with rotation: rotation = 0 portrait, 1= landscape, 2 portrait upside down, 3= landscape upside down
34+
#initialise class with rotation: rotation = 0 portrait, 1= landscape,
35+
# 2 portrait upside down, 3= landscape upside down
3536
epd = EPD_2in13_B(1)
3637
#clear class
3738
epd.Clear(0x00, 0x00)
@@ -52,13 +53,39 @@ try:
5253

5354
except KeyboardInterrupt:
5455
print ("exception")
55-
56-
5756
```
5857

58+
Another example with rotated red frame buffer layer
59+
```python
60+
from epd_2in13_b import EPD_2in13_B
5961

62+
try:
63+
#initialise class with rotation: rotation = 0 portrait, 1= landscape,
64+
# 2 portrait upside down, 3= landscape upside down
65+
epd = EPD_2in13_B(1)
66+
#clear class
67+
epd.Clear(0x00, 0x00)
68+
# Clear black framebuffer
69+
epd.framebuffer_black.fill(0x00)
70+
# Clear red framebuffer
71+
epd.framebuffer_red.fill(0x00)
72+
# Write text to black framebuffer
73+
epd.framebuffer_black.text('Black text in 0,0 position.', 0, 0, 0xff)
74+
# Write text red framebuffer
6075

76+
# Change red framebuffer rotation to upside down
77+
epd.framebuffer_red.rotation = 3
78+
# draw text now upside down..
79+
epd.framebuffer_red.text('red text in 0,0 position.', 0, 8, 0xff)
6180

81+
# Draw everything to display, this will take around 15 sec per layer
82+
epd.display()
83+
# put the display on the sleep mode
84+
epd.sleep();
85+
86+
except KeyboardInterrupt:
87+
print ("exception")
88+
```
6289

6390

6491

0 commit comments

Comments
 (0)