Skip to content

Commit a1d7a7a

Browse files
committed
Improve docs, add reference to GPS.
1 parent 89c120e commit a1d7a7a

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

HD44780/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Driver for character-based LCD displays
2+
3+
This driver is for displays based on the Hitachi HD44780 driver: these are
4+
widely available, typically in 16 character x 2 rows format.
5+
6+
# Files
7+
8+
* `alcd.py` Driver, includes connection details.
9+
* `alcdtest.py` Test/demo script.
10+
11+
Currently most of the documentation, including wiring details, is in the code.
12+
13+
# Display Formatting
14+
15+
The driver represents an LCD display as an array indexed by row. Assigning a
16+
string to a row causes that row to be updated. To write text to a specific
17+
column of the display it is recommended to use the Python string `format`
18+
method.
19+
20+
For exampls this function formats a string such that it is left-padded with
21+
spaces to a given column and right-padded to the specified width (typically the
22+
width of the display). This ensures previous contents are overwritten.
23+
24+
```python
25+
def print_at(st, col, width=16):
26+
return '{:>{col}s}{:{t}s}'.format(st,'', col=col+len(st), t = width-(col+len(st)))
27+
```
28+
29+
```
30+
>>> print_at('cat', 2)
31+
' cat '
32+
>>> len(_)
33+
16
34+
>>>
35+
```
36+
37+
Similar use of the `format` method can be used to achieve more complex
38+
tabulated data layouts.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ This GitHub repository consists of the following parts:
1313
* [A driver for the HTU21D](./htu21d/README.md) temperature and humidity
1414
sensor. This is intended to be portable across platforms and is another
1515
example of an asynchronous device driver.
16+
* [A driver for character LCD displays](./HD44780/README.md). A simple
17+
asynchronous interface to displays based on the Hitachi HD44780 chip.
18+
* [A driver for GPS modules](./gps/README.md) Runs a background task to read
19+
and decode NMEA sentences, providing constantly updated position, course,
20+
altitude and time/date information.
1621
* [A modified uasyncio](./FASTPOLL.md) This incorporates a simple priority
1722
mechanism. With suitable application design this improves the rate at which
1823
devices can be polled and improves the accuracy of time delays. Also provides

0 commit comments

Comments
 (0)