@@ -37,18 +37,13 @@ or individual libraries can be installed using
3737`circup <https://github.com/adafruit/circup >`_.
3838
3939
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.
40+ * `3.7" 416x240 Monochrome Black/White eInk / ePaper - Bare Display - UC8253 Chipset <https://www.adafruit.com/product/6395 >`_
41+ * `3.7" 416x240 Tri-Color Red / Black / White eInk - Bare Display - UC8253 Chipset <https://www.adafruit.com/product/6394 >`_
4342
4443`Purchase one from the Adafruit shop <http://www.adafruit.com/products/ >`_
4544
4645Installing from PyPI
4746=====================
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.
5247
5348On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
5449PyPI <https://pypi.org/project/adafruit-circuitpython-uc8253/> `_.
@@ -99,8 +94,56 @@ Or the following command to update an existing version:
9994 Usage Example
10095=============
10196
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.
97+ .. code-block :: python
98+
99+ import time
100+
101+ import board
102+ import busio
103+ import displayio
104+ from fourwire import FourWire
105+
106+ import adafruit_uc8253
107+
108+ displayio.release_displays()
109+
110+ # This pinout works on a MagTag with the newer screen and may need to be altered for other boards.
111+ spi = busio.SPI(board.EPD_SCK , board.EPD_MOSI ) # Uses SCK and MOSI
112+ epd_cs = board.EPD_CS
113+ epd_dc = board.EPD_DC
114+ epd_reset = board.EPD_RESET
115+ epd_busy = board.EPD_BUSY
116+
117+ display_bus = FourWire(spi, command = epd_dc, chip_select = epd_cs, reset = epd_reset, baudrate = 1000000 )
118+ time.sleep(1 )
119+
120+ display = adafruit_uc8253.UC8253(
121+ display_bus, width = 240 , height = 416 , busy_pin = epd_busy, rotation = 0 , vcom_cdi = 0x 97
122+ )
123+
124+ g = displayio.Group()
125+
126+ pic = displayio.OnDiskBitmap(" /display-ruler-1280x720.bmp" )
127+ t = displayio.TileGrid(pic, pixel_shader = pic.pixel_shader)
128+ g.append(t)
129+
130+ display.root_group = g
131+
132+ display.refresh()
133+
134+ print (" refreshed" )
135+
136+ time.sleep(display.time_to_refresh + 5 )
137+ # Always refresh a little longer. It's not a problem to refresh
138+ # a few seconds more, but it's terrible to refresh too early
139+ # (the display will throw an exception when if the refresh
140+ # is too soon)
141+ print (" waited correct time" )
142+
143+ # Keep the display the same
144+ while True :
145+ time.sleep(10 )
146+
104147
105148 Documentation
106149=============
0 commit comments