Skip to content

Commit af99a55

Browse files
fixed installation instructions and inline comments, added missing imports
1 parent 7dfc8ce commit af99a55

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

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))

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))

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)