Filled out remaining TODOs
This commit is contained in:
parent
18251e7251
commit
27cb072dcc
1 changed files with 36 additions and 2 deletions
38
README.rst
38
README.rst
|
|
@ -13,7 +13,7 @@ Introduction
|
|||
:target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_ILI9341
|
||||
:alt: Build Status
|
||||
|
||||
.. todo:: Describe what the library does.
|
||||
displayio driver for ILI9341 and ILI9340 TFT-LCD displays.
|
||||
|
||||
Dependencies
|
||||
=============
|
||||
|
|
@ -28,7 +28,41 @@ This is easily achieved by downloading
|
|||
Usage Example
|
||||
=============
|
||||
|
||||
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
|
||||
.. code-block:: python
|
||||
|
||||
import board
|
||||
import displayio
|
||||
import adafruit_ili9341
|
||||
|
||||
spi = board.SPI()
|
||||
tft_cs = board.D9
|
||||
tft_dc = board.D10
|
||||
|
||||
displayio.release_displays()
|
||||
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
|
||||
|
||||
display = adafruit_ili9341.ILI9341(display_bus)
|
||||
|
||||
# Make the display context
|
||||
splash = displayio.Group(max_size=10)
|
||||
display.show(splash)
|
||||
|
||||
color_bitmap = displayio.Bitmap(320, 240, 1)
|
||||
color_palette = displayio.Palette(1)
|
||||
color_palette[0] = 0xFF0000
|
||||
|
||||
try:
|
||||
bg_sprite = displayio.TileGrid(color_bitmap,
|
||||
pixel_shader=color_palette,
|
||||
position=(0, 0))
|
||||
except TypeError:
|
||||
bg_sprite = displayio.TileGrid(color_bitmap,
|
||||
pixel_shader=color_palette,
|
||||
x=0, y=0)
|
||||
splash.append(bg_sprite)
|
||||
|
||||
while True:
|
||||
pass
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
|
|
|||
Loading…
Reference in a new issue