@@ -36,19 +36,10 @@ This is easily achieved by downloading
36
36
or individual libraries can be installed using
37
37
`circup <https://github.com/adafruit/circup >`_.
38
38
39
-
40
-
41
- .. todo :: Describe the Adafruit product this library works with. For PCBs, you can also add the
42
- image from the assets folder in the PCB's GitHub repo.
43
-
44
39
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/6373 >`_
45
40
46
41
Installing from PyPI
47
42
=====================
48
- .. note :: This library is not available on PyPI yet. Install documentation is included
49
- as a standard element. Stay tuned for PyPI availability!
50
-
51
- .. todo :: Remove the above note if PyPI version is/will be available at time of release.
52
43
53
44
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
54
45
PyPI <https://pypi.org/project/adafruit-circuitpython-jd79661/> `_.
@@ -99,8 +90,64 @@ Or the following command to update an existing version:
99
90
Usage Example
100
91
=============
101
92
102
- .. todo :: Add a quick, simple example. It and other examples should live in the
103
- examples folder and be included in docs/examples.rst.
93
+ .. code-block :: python
94
+
95
+ import time
96
+
97
+ import board
98
+ import busio
99
+ import displayio
100
+ from fourwire import FourWire
101
+
102
+ import adafruit_jd79661
103
+
104
+ displayio.release_displays()
105
+
106
+ # This pinout works on a MagTag with the newer screen and may need to be altered for other boards.
107
+ spi = busio.SPI(board.EPD_SCK , board.EPD_MOSI ) # Uses SCK and MOSI
108
+ epd_cs = board.EPD_CS
109
+ epd_dc = board.EPD_DC
110
+ epd_reset = board.EPD_RESET
111
+ epd_busy = board.EPD_BUSY
112
+
113
+ display_bus = FourWire(spi, command = epd_dc, chip_select = epd_cs, reset = epd_reset, baudrate = 1000000 )
114
+ time.sleep(1 )
115
+
116
+ display = adafruit_jd79661.JD79661(
117
+ display_bus,
118
+ width = 250 ,
119
+ height = 122 ,
120
+ busy_pin = epd_busy,
121
+ rotation = 270 ,
122
+ colstart = 0 ,
123
+ highlight_color = 0x 00FF00 ,
124
+ highlight_color2 = 0x FF0000 ,
125
+ )
126
+
127
+ g = displayio.Group()
128
+
129
+ pic = displayio.OnDiskBitmap(" /display-ruler-640x360.bmp" )
130
+ t = displayio.TileGrid(pic, pixel_shader = pic.pixel_shader)
131
+ g.append(t)
132
+
133
+ display.root_group = g
134
+
135
+ display.refresh()
136
+
137
+ print (" refreshed" )
138
+
139
+ time.sleep(display.time_to_refresh + 5 )
140
+ # Always refresh a little longer. It's not a problem to refresh
141
+ # a few seconds more, but it's terrible to refresh too early
142
+ # (the display will throw an exception when if the refresh
143
+ # is too soon)
144
+ print (" waited correct time" )
145
+
146
+
147
+ # Keep the display the same
148
+ while True :
149
+ time.sleep(10 )
150
+
104
151
105
152
Documentation
106
153
=============
0 commit comments