File tree Expand file tree Collapse file tree 4 files changed +16
-12
lines changed
Expand file tree Collapse file tree 4 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ Connect the MicroPython device to a network (if possible)
6767``` python
6868import network
6969station = network.WLAN(network.STA_IF )
70+ station.active(True )
7071station.connect(' SSID' , ' PASSWORD' )
7172station.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
164165from machine import I2C , Pin
165- from time import gmtime
166+ from time import gmtime, time
166167
167- I2C_ADDR = 0x 68
168+ # DS1307 on 0x68
169+ I2C_ADDR = 0x 68 # 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
172174i2c = 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
176178print (" Current RTC time: {} " .format(ds1307.datetime))
Original file line number Diff line number Diff 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
1616from machine import I2C , Pin
1717
18- I2C_ADDR = 0x 68
18+ # DS1307 on 0x68
19+ I2C_ADDR = 0x 68 # 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
2324i2c = 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
2728print (" DS1307 is on I2C address 0x{0:02x } " .format(ds1307.addr))
Original file line number Diff line number Diff line change 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
77from machine import I2C , Pin
88from 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
1516i2c = 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
1920print ("DS1307 is on I2C address 0x{0:02x}" .format (ds1307 .addr ))
Original file line number Diff line number Diff line change 1616setup (
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' ,
You can’t perform that action at this time.
0 commit comments