Skip to content

Commit 35113bb

Browse files
Merge pull request #3 from brainelectronics/bugfix/docs-and-usage-fixes
Docs and usage fixes
2 parents 986cde0 + 30099d0 commit 35113bb

File tree

9 files changed

+36
-14
lines changed

9 files changed

+36
-14
lines changed

.github/workflows/test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ jobs:
5252
- name: Test built package
5353
run: |
5454
twine check dist/*
55+
- name: Validate mip package file
56+
run: |
57+
upy-package \
58+
--setup_file setup.py \
59+
--package_changelog_file changelog.md \
60+
--package_file package.json \
61+
--validate \
62+
--ignore-version

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
[![codecov](https://codecov.io/github/brainelectronics/micropython-i2c-lcd/branch/main/graph/badge.svg)](https://app.codecov.io/github/brainelectronics/micropython-i2c-lcd)
88
[![CI](https://github.com/brainelectronics/micropython-i2c-lcd/actions/workflows/release.yml/badge.svg)](https://github.com/brainelectronics/micropython-i2c-lcd/actions/workflows/release.yml)
99

10-
Micropython package to control HD44780 LCD displays 1602 and 2004 via I2C
10+
MicroPython package to control HD44780 LCD displays 1602 and 2004 via I2C
1111

1212
---------------
1313

1414
## General
1515

16-
Micropython package to control HD44780 LCD displays 1602 and 2004 via I2C
16+
MicroPython package to control HD44780 LCD displays 1602 and 2004 via I2C
1717

1818
📚 The latest documentation is available at
1919
[MicroPython I2C LCD ReadTheDocs][ref-rtd-micropython-i2c-lcd] 📚
@@ -65,6 +65,7 @@ Connect the MicroPython device to a network (if possible)
6565
```python
6666
import network
6767
station = network.WLAN(network.STA_IF)
68+
station.active(True)
6869
station.connect('SSID', 'PASSWORD')
6970
station.isconnected()
7071
```
@@ -158,13 +159,14 @@ cp examples/boot.py /pyboard
158159
from lcd_i2c import LCD
159160
from machine import I2C, Pin
160161

161-
I2C_ADDR = 0x27
162+
# PCF8574 on 0x50
163+
I2C_ADDR = 0x27 # DEC 39, HEX 0x27
162164
NUM_ROWS = 2
163165
NUM_COLS = 16
164166

165167
# define custom I2C interface, default is 'I2C(0)'
166168
# check the docs of your device for further details and pin infos
167-
i2c = I2C(1, scl=Pin(3), sda=Pin(2), freq=800_000)
169+
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
168170
lcd = LCD(addr=I2C_ADDR, cols=NUM_COLS, rows=NUM_ROWS, i2c=i2c)
169171

170172
lcd.begin()

changelog.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
1717
-->
1818

1919
## Released
20+
## [0.1.1] - 2023-06-12
21+
### Fixed
22+
- Usage documentation with more comments and WiFi instructions in root README
23+
- Validate `package.json` file in test workflow
24+
2025
## [0.1.0] - 2023-03-09
2126
### Added
2227
- `const.py`, `display.py` and `typing.py` in `lcd_i2c` module
@@ -29,6 +34,7 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
2934
- Not used files provided with [template repo](https://github.com/brainelectronics/micropython-i2c-lcd)
3035

3136
<!-- Links -->
32-
[Unreleased]: https://github.com/brainelectronics/micropython-i2c-lcd/compare/0.1.0...main
37+
[Unreleased]: https://github.com/brainelectronics/micropython-i2c-lcd/compare/0.1.1...main
3338

34-
[0.1.0]: https://github.com/brainelectronics/micropython-i2c-lcd/tree/0.6.0
39+
[0.1.1]: https://github.com/brainelectronics/micropython-i2c-lcd/tree/0.1.1
40+
[0.1.0]: https://github.com/brainelectronics/micropython-i2c-lcd/tree/0.1.0

docs/EXAMPLES.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ An example of all implemented functionalities can be found at the
1515
from lcd_i2c import LCD
1616
from machine import I2C, Pin
1717

18+
# PCF8574 on 0x27
1819
I2C_ADDR = 0x27
1920
NUM_ROWS = 2
2021
NUM_COLS = 16
2122

2223
# define custom I2C interface, default is 'I2C(0)'
2324
# check the docs of your device for further details and pin infos
24-
i2c = I2C(1, scl=Pin(3), sda=Pin(2), freq=800_000)
25+
# this are the pins for the Raspberry Pi Pico adapter board
26+
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
2527
lcd = LCD(addr=I2C_ADDR, cols=NUM_COLS, rows=NUM_ROWS, i2c=i2c)
2628

2729
# get LCD infos/properties

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Micropython package to control HD44780 LCD displays via I2C
1+
MicroPython package to control HD44780 LCD displays via I2C
22
===========================================================
33

44
Contents

examples/main.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from machine import I2C, Pin
88
from time import sleep
99

10-
I2C_ADDR = 0x27
10+
# PCF8574 on 0x27
11+
I2C_ADDR = 0x27 # DEC 39, HEX 0x27
1112
I2C_NUM_ROWS = 2
1213
I2C_NUM_COLS = 16
1314
FREQ = 800000 # Try lowering this value in case of "Errno 5"
@@ -28,7 +29,8 @@ def print_and_wait(text: str, sleep_time: int = 2) -> None:
2829

2930
# define custom I2C interface, default is 'I2C(0)'
3031
# check the docs of your device for further details and pin infos
31-
i2c = I2C(1, scl=Pin(3), sda=Pin(2), freq=FREQ)
32+
# this are the pins for the Raspberry Pi Pico adapter board
33+
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=FREQ)
3234
lcd = LCD(addr=I2C_ADDR, cols=I2C_NUM_COLS, rows=I2C_NUM_ROWS, i2c=i2c)
3335

3436
# get LCD infos/properties
@@ -155,4 +157,5 @@ def print_and_wait(text: str, sleep_time: int = 2) -> None:
155157

156158
# show custom char stored at location 0
157159
lcd.print(chr(0))
160+
lcd.print(chr(0))
158161
print_and_wait("Show custom char")

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"github:brainelectronics/micropython-i2c-lcd/lcd_i2c/version.py"
2222
]
2323
],
24-
"deps": [
25-
],
24+
"deps": [],
2625
"version": "0.1.0"
2726
}

requirements-test.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ flake8>=5.0.0,<6
44
coverage>=6.4.2,<7
55
nose2>=0.12.0,<1
66
yamllint>=1.29,<2
7+
setup2upypackage>=0.2.0,<1

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
setup(
1717
name='micropython-i2c-lcd',
1818
version=__version__,
19-
description="Micropython package to control HD44780 LCD displays 1602 and 2004 ",
19+
description="MicroPython package to control HD44780 LCD displays 1602 and 2004",
2020
long_description=long_description,
2121
long_description_content_type='text/markdown',
2222
url='https://github.com/brainelectronics/micropython-i2c-lcd',
@@ -26,8 +26,9 @@
2626
'Development Status :: 4 - Beta',
2727
'Intended Audience :: Developers',
2828
'License :: OSI Approved :: MIT License',
29+
'Programming Language :: Python :: Implementation :: MicroPython',
2930
],
30-
keywords='micropython, HD44780, I2C, display, LCD1602, LCD2004',
31+
keywords='micropython, HD44780, I2C, display, LCD1602, LCD2004, PCF8574',
3132
project_urls={
3233
'Bug Reports': 'https://github.com/brainelectronics/micropython-i2c-lcd/issues',
3334
'Source': 'https://github.com/brainelectronics/micropython-i2c-lcd',

0 commit comments

Comments
 (0)