@@ -31,7 +31,8 @@ https://docs.circuitpython.org/projects/framebuf/en/latest/ and https://github.c
3131from epd_2in13_b import EPD_2in13_B
3232
3333try :
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(0x 00 , 0x 00 )
5253
5354except 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(0x 00 , 0x 00 )
68+ # Clear black framebuffer
69+ epd.framebuffer_black.fill(0x 00 )
70+ # Clear red framebuffer
71+ epd.framebuffer_red.fill(0x 00 )
72+ # Write text to black framebuffer
73+ epd.framebuffer_black.text(' Black text in 0,0 position.' , 0 , 0 , 0x ff )
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 , 0x ff )
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