@@ -3,19 +3,21 @@ Python usage
33
44Pixel Drivers
55^^^^^^^^^^^^^
6+
67The PCD8544 is driven with python using the implementation in the
7- :py:class: `luma.lcd.device.pcd8544 ` class. Likewise, to drive the ST7735 or
8- UC1701X, use the :py:class: `luma.lcd.device.st7735 ` or
9- :py:class: `luma.lcd.device.uc1701x ` class respectively. Usage is very simple if
10- you have ever used `Pillow <https://pillow.readthedocs.io/en/latest/ >`_ or PIL.
8+ :py:class: `luma.lcd.device.pcd8544 ` class. Likewise, to drive the ST7735,
9+ UC1701X or LS013B4DN04, use the :py:class: `luma.lcd.device.st7735 `,
10+ :py:class: `luma.lcd.device.uc1701x `, :py:class: `luma.lcd.device.ls013b4dn04 ` or
11+ class respectively. Usage is very simple if you have ever used `Pillow
12+ <https://pillow.readthedocs.io/en/latest/> `_ or PIL.
1113
1214First, import and initialise the device:
1315
1416.. code :: python
1517
1618 from luma.core.interface.serial import spi
1719 from luma.core.render import canvas
18- from luma.lcd.device import pcd8544, st7735, uc1701x
20+ from luma.lcd.device import pcd8544, st7735, uc1701x, ls013b4dn04
1921
2022 serial = spi(port = 0 , device = 0 , gpio_DC = 23 , gpio_RST = 24 )
2123 device = pcd8544(serial)
@@ -24,8 +26,9 @@ The display device should now be configured for use. Note, all the example code
2426snippets in this section are interchangeable between PCD8544 and ST7735
2527devices.
2628
27- The :py:class: `~luma.lcd.device.pcd8544 `, :py:class: `~luma.lcd.device.st7735 ` and
28- :py:class: `~luma.lcd.device.uc1701x ` classes all expose a
29+ The :py:class: `~luma.lcd.device.pcd8544 `, :py:class: `~luma.lcd.device.st7735 `,
30+ :py:class: `~luma.lcd.device.uc1701x ` and
31+ :py:class: `~luma.lcd.device.ls013b4dn04 ` classes all expose a
2932:py:meth: `~luma.lcd.device.pcd8544.display ` method which takes an image with
3033attributes consistent with the capabilities of the device. However, for most
3134cases, for drawing text and graphics primitives, the canvas class should be
@@ -67,9 +70,10 @@ colour RGB images, whereby 24-bit RGB images are downscaled to 18-bit RGB.
6770Landscape / Portrait Orientation
6871""""""""""""""""""""""""""""""""
6972By default the PCD8544, ST7735 and UC1701X displays will all be oriented in
70- landscape mode (84x48, 160x128 and 128x64 pixels respectively). Should you have
71- an application that requires the display to be mounted in a portrait aspect,
72- then add a :py:attr: `rotate=N ` parameter when creating the device:
73+ landscape mode (84x48, 160x128 and 128x64 pixels respectively). The LS013B4DN04
74+ supports a native resolution of 96x96 pixels. Should you have an application
75+ that requires the display to be mounted in a portrait aspect, then add a
76+ :py:attr: `rotate=N ` parameter when creating the device:
7377
7478.. code :: python
7579
@@ -93,9 +97,9 @@ properties reflect the rotated dimensions rather than the physical dimensions.
9397
9498Seven-Segment Drivers
9599^^^^^^^^^^^^^^^^^^^^^
96- The HT1621 is driven with the :py:class: `luma. lcd.device.ht1621 ` class, but is
97- not accessed directly: it should be wrapped with the :py:class: ` luma.core.virtual.sevensegment `
98- wrapper, as follows:
100+ The HT1621 is driven with the :py:class: `luma, lcd.device.ht1621 ` class, but is
101+ not accessed directly: it should be wrapped with the
102+ :py:class: ` luma.core.virtual.sevensegment ` wrapper, as follows:
99103
100104.. code :: python
101105
@@ -104,13 +108,13 @@ wrapper, as follows:
104108
105109 device = ht1621()
106110 seg = sevensegment(device)
107-
108-
109- The **seg ** instance now has a :py:attr: ` ~luma.led_matrix.virtual.sevensegment.text `
110- property which may be assigned, and when it does will update all digits
111- according to the limited alphabet the 7-segment displays support. For example,
112- assuming there are 2 cascaded modules, we have 16 character available, and so
113- can write:
111+
112+
113+ The **seg ** instance now has a
114+ :py:attr: ` ~luma.led_matrix.virtual.sevensegment.text ` property which may be
115+ assigned, and when it does will update all digits according to the limited
116+ alphabet the 7-segment displays support. For example, assuming there are 2
117+ cascaded modules, we have 16 character available, and so can write:
114118
115119.. code :: python
116120
0 commit comments