Skip to content

Commit 0b92b90

Browse files
Merge pull request #2 from brainelectronics/bugfix/docs-and-usage-fixes
docs and usage fixes
2 parents 7dfc8ce + 48c9aec commit 0b92b90

File tree

7 files changed

+26
-15
lines changed

7 files changed

+26
-15
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ jobs:
6262
--setup_file setup.py \
6363
--package_changelog_file changelog.md \
6464
--package_file package.json \
65-
--validate
65+
--validate \
66+
--ignore-version

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Connect the MicroPython device to a network (if possible)
6767
```python
6868
import network
6969
station = network.WLAN(network.STA_IF)
70+
station.active(True)
7071
station.connect('SSID', 'PASSWORD')
7172
station.isconnected()
7273
```
@@ -160,17 +161,18 @@ cp examples/boot.py /pyboard
160161
## Usage
161162

162163
```python
163-
from eeprom import DS1307
164+
from ds1307 import DS1307
164165
from machine import I2C, Pin
165-
from time import gmtime
166+
from time import gmtime, time
166167

167-
I2C_ADDR = 0x68
168+
# DS1307 on 0x68
169+
I2C_ADDR = 0x68 # DEC 104, HEX 0x68
168170

169171
# define custom I2C interface, default is 'I2C(0)'
170172
# check the docs of your device for further details and pin infos
171173
# this are the pins for the Raspberry Pi Pico adapter board
172174
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
173-
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c) # DS1307 on 0x68
175+
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c)
174176

175177
# get the current RTC time
176178
print("Current RTC time: {}".format(ds1307.datetime))

changelog.md

Lines changed: 7 additions & 1 deletion
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+
- Ignore version of `package.json` file in test workflow
24+
2025
## [0.1.0] - 2023-05-01
2126
### Added
2227
- `ds1307.py` in `ds1307` 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-ds1307/compare/0.1.0...main
37+
[Unreleased]: https://github.com/brainelectronics/micropython-ds1307/compare/0.1.1...main
3338

39+
[0.1.1]: https://github.com/brainelectronics/micropython-ds1307/tree/0.1.1
3440
[0.1.0]: https://github.com/brainelectronics/micropython-ds1307/tree/0.1.0

docs/EXAMPLES.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ An example of all implemented functionalities can be found at the
1212
## Setup DS1307
1313

1414
```python
15-
from eeprom import DS1307
15+
from ds1307 import DS1307
1616
from machine import I2C, Pin
1717

18-
I2C_ADDR = 0x68
18+
# DS1307 on 0x68
19+
I2C_ADDR = 0x68 # DEC 104, HEX 0x68
1920

2021
# define custom I2C interface, default is 'I2C(0)'
2122
# check the docs of your device for further details and pin infos
2223
# this are the pins for the Raspberry Pi Pico adapter board
2324
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
24-
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c) # DS1307 on 0x68
25+
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c)
2526

2627
# get LCD infos/properties
2728
print("DS1307 is on I2C address 0x{0:02x}".format(ds1307.addr))

examples/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/usr/bin/env python3
22
# -*- coding: UTF-8 -*-
33

4-
"""I2C EEPROM showcase"""
4+
"""I2C DS1307 showcase"""
55

6-
from eeprom import DS1307
6+
from ds1307 import DS1307
77
from machine import I2C, Pin
88
from time import gmtime, sleep, time
99

10-
I2C_ADDR = 0x68
10+
# DS1307 on 0x68
11+
I2C_ADDR = 0x68 # DEC 104, HEX 0x68
1112

1213
# define custom I2C interface, default is 'I2C(0)'
1314
# check the docs of your device for further details and pin infos
1415
# this are the pins for the Raspberry Pi Pico adapter board
1516
i2c = I2C(0, scl=Pin(13), sda=Pin(12), freq=800000)
16-
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c) # DS1307 on 0x68
17+
ds1307 = DS1307(addr=I2C_ADDR, i2c=i2c)
1718

1819
# get LCD infos/properties
1920
print("DS1307 is on I2C address 0x{0:02x}".format(ds1307.addr))

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +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.1.0,<1
7+
setup2upypackage>=0.2.0,<1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
setup(
1717
name='micropython-ds1307',
1818
version=__version__,
19-
description=" MicroPython driver for DS1307 RTC ",
19+
description="MicroPython driver for DS1307 RTC",
2020
long_description=long_description,
2121
long_description_content_type='text/markdown',
2222
url='https://github.com/brainelectronics/micropython-ds1307',

0 commit comments

Comments
 (0)