/ README.rst
README.rst
1 Introduction 2 ============ 3 4 .. image:: https://readthedocs.org/projects/adafruit-circuitpython-il91874/badge/?version=latest 5 :target: https://circuitpython.readthedocs.io/projects/il91874/en/latest/ 6 :alt: Documentation Status 7 8 .. image:: https://img.shields.io/discord/327254708534116352.svg 9 :target: https://adafru.it/discord 10 :alt: Discord 11 12 .. image:: https://github.com/adafruit/Adafruit_CircuitPython_IL91874/workflows/Build%20CI/badge.svg 13 :target: https://github.com/adafruit/Adafruit_CircuitPython_IL91874/actions 14 :alt: Build Status 15 16 CircuitPython `displayio` driver for IL91874-based ePaper displays 17 18 19 Dependencies 20 ============= 21 This driver depends on: 22 23 * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_ 24 25 Please ensure all dependencies are available on the CircuitPython filesystem. 26 This is easily achieved by downloading 27 `the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_. 28 29 Installing from PyPI 30 ===================== 31 32 On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from 33 PyPI <https://pypi.org/project/adafruit-circuitpython-il91874/>`_. To install for current user: 34 35 .. code-block:: shell 36 37 pip3 install adafruit-circuitpython-il91874 38 39 To install system-wide (this may be required in some cases): 40 41 .. code-block:: shell 42 43 sudo pip3 install adafruit-circuitpython-il91874 44 45 To install in a virtual environment in your current project: 46 47 .. code-block:: shell 48 49 mkdir project-name && cd project-name 50 python3 -m venv .env 51 source .env/bin/activate 52 pip3 install adafruit-circuitpython-il91874 53 54 Usage Example 55 ============= 56 57 .. code-block:: python 58 59 """Simple test script for 2.7" 264x176 Tri-Color display shield 60 61 Supported products: 62 * Adafruit 2.7" Tri-Color ePaper Display Shield 63 * https://www.adafruit.com/product/4229 64 """ 65 66 import time 67 import board 68 import busio 69 import displayio 70 import adafruit_il91874 71 72 displayio.release_displays() 73 74 spi = board.SPI() 75 epd_cs = board.D10 76 epd_dc = board.D9 77 78 display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000) 79 time.sleep(1) 80 81 display = adafruit_il91874.IL91874(display_bus, width=264, height=176, highlight_color=0xff0000, rotation=90) 82 83 g = displayio.Group() 84 85 f = open("/display-ruler.bmp", "rb") 86 87 pic = displayio.OnDiskBitmap(f) 88 t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter()) 89 g.append(t) 90 91 display.show(g) 92 93 display.refresh() 94 95 print("refreshed") 96 97 time.sleep(120) 98 99 Contributing 100 ============ 101 102 Contributions are welcome! Please read our `Code of Conduct 103 <https://github.com/adafruit/Adafruit_CircuitPython_IL91874/blob/master/CODE_OF_CONDUCT.md>`_ 104 before contributing to help this project stay welcoming. 105 106 Documentation 107 ============= 108 109 For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.