Skip to content

Commit 8d28c28

Browse files
authored
Merge pull request #4 from makermelissa/master
Fixed comment on amount of delay to be accurate
2 parents c7fedd3 + e7f5ff5 commit 8d28c28

File tree

4 files changed

+56
-15
lines changed

4 files changed

+56
-15
lines changed

README.rst

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Introduction
1313
:target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_ILI9341
1414
:alt: Build Status
1515

16-
.. todo:: Describe what the library does.
16+
displayio driver for ILI9341 and ILI9340 TFT-LCD displays.
1717

1818
Dependencies
1919
=============
@@ -28,7 +28,41 @@ This is easily achieved by downloading
2828
Usage Example
2929
=============
3030

31-
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
31+
.. code-block:: python
32+
33+
import board
34+
import displayio
35+
import adafruit_ili9341
36+
37+
spi = board.SPI()
38+
tft_cs = board.D9
39+
tft_dc = board.D10
40+
41+
displayio.release_displays()
42+
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
43+
44+
display = adafruit_ili9341.ILI9341(display_bus)
45+
46+
# Make the display context
47+
splash = displayio.Group(max_size=10)
48+
display.show(splash)
49+
50+
color_bitmap = displayio.Bitmap(320, 240, 1)
51+
color_palette = displayio.Palette(1)
52+
color_palette[0] = 0xFF0000
53+
54+
try:
55+
bg_sprite = displayio.TileGrid(color_bitmap,
56+
pixel_shader=color_palette,
57+
position=(0, 0))
58+
except TypeError:
59+
bg_sprite = displayio.TileGrid(color_bitmap,
60+
pixel_shader=color_palette,
61+
x=0, y=0)
62+
splash.append(bg_sprite)
63+
64+
while True:
65+
pass
3266
3367
Contributing
3468
============

adafruit_ili9341.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
2222
"""
23-
`adafruit_ILI9341`
23+
`adafruit_ili9341`
2424
====================================================
2525
2626
Display driver for ILI9341
@@ -32,9 +32,16 @@
3232
3333
**Hardware:**
3434
35-
.. todo:: Add links to any specific hardware product page(s), or category page(s).
36-
Use unordered list & hyperlink rST
37-
inline format: "* `Link Text <url>`_"
35+
* 2.2" 18-bit color TFT LCD display with microSD card breakout
36+
<https://www.adafruit.com/product/1480>
37+
* 2.4" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket
38+
<https://www.adafruit.com/product/2478>
39+
* 2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket
40+
<https://www.adafruit.com/product/1770>
41+
* 3.2" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket
42+
<https://www.adafruit.com/product/1743>
43+
* TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers
44+
<https://www.adafruit.com/product/3315>
3845
3946
**Software and Dependencies:**
4047
@@ -49,7 +56,7 @@
4956
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ILI9341.git"
5057

5158
_INIT_SEQUENCE = (
52-
b"\x01\x80\x80"# Software reset then delay 0x78 (120ms)
59+
b"\x01\x80\x80" # Software reset then delay 0x80 (128ms)
5360
b"\xEF\x03\x03\x80\x02"
5461
b"\xCF\x03\x00\xC1\x30"
5562
b"\xED\x04\x64\x03\x12\x81"
@@ -70,8 +77,8 @@
7077
b"\x26\x01\x01" # Gamma curve selected
7178
b"\xe0\x0f\x0F\x31\x2B\x0C\x0E\x08\x4E\xF1\x37\x07\x10\x03\x0E\x09\x00" # Set Gamma
7279
b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma
73-
b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms)
74-
b"\x29\x80\x78"# Display on then delay 0x78 (120ms)
80+
b"\x11\x80\x78" # Exit Sleep then delay 0x78 (120ms)
81+
b"\x29\x80\x78" # Display on then delay 0x78 (120ms)
7582
)
7683

7784
# pylint: disable=too-few-public-methods

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# digitalio, micropython and busio. List the modules you use. Without it, the
2222
# autodoc module docs will fail to generate with a warning.
2323
# autodoc_mock_imports = ["digitalio", "busio"]
24-
24+
autodoc_mock_imports = ["displayio"]
2525

2626
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
2727

docs/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27-
the toctree above for use later.
28-
2926
.. toctree::
3027
:caption: Related Products
3128

32-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
33-
the toctree above for use later.
29+
2.2" 18-bit color TFT LCD display with microSD card breakout <https://www.adafruit.com/product/1480>
30+
2.4" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket <https://www.adafruit.com/product/2478>
31+
2.8" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket <https://www.adafruit.com/product/1770>
32+
3.2" TFT LCD with Touchscreen Breakout Board w/MicroSD Socket <https://www.adafruit.com/product/1743>
33+
TFT FeatherWing - 2.4" 320x240 Touchscreen For All Feathers <https://www.adafruit.com/product/3315>
3434

3535
.. toctree::
3636
:caption: Other Links

0 commit comments

Comments
 (0)