Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HAIZAKURA/esp-ds3231-micropython
A DS3231 Lib for esp8266/esp32 with MicroPython.
https://github.com/HAIZAKURA/esp-ds3231-micropython
Last synced: about 2 months ago
JSON representation
A DS3231 Lib for esp8266/esp32 with MicroPython.
- Host: GitHub
- URL: https://github.com/HAIZAKURA/esp-ds3231-micropython
- Owner: HAIZAKURA
- License: mit
- Created: 2020-03-27T09:10:36.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-19T06:18:54.000Z (over 4 years ago)
- Last Synced: 2024-04-22T12:33:32.746Z (9 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - esp-ds3231-micropython - A DS3231 library for ESP8266/ESP32 with MicroPython. (Libraries / Communications)
README
# esp-ds3231-micropython
[![Author](https://img.shields.io/badge/Author-HAIZAKURA-b68469?style=flat-square)](https://nya.run) [![License](https://img.shields.io/github/license/HAIZAKURA/esp-ds3231-micropython?style=flat-square)](./LICENSE)A DS3231 Lib for esp8266/esp32 with MicroPython.
If you are using pyboard or another board, please modify the usage of `Pin` and `I2C` in `ds3231.py` .
## Usage
```python
from ds3231 import DS3231ds = DS3231(sdapin=18, sclpin=19)
# get year
ds.year()
# set year
ds.year(2020)# get month
ds.month()
# set month
ds.month(3)# get day
ds.day()
# set day
ds.day(27)# get hour
ds.hour()
# set hour
ds.hour(17)# get minute
ds.min()
# set minute
ds.min(16)# get second
ds.sec()
# set second
ds.sec(45)# get time
# [17, 16, 45]
ds.time()
# set time
ds.time(17, 16, 45)# get date
# [2020, 3, 27]
ds.date()
# set date
ds.date(2020, 3, 27)# get datetime
# [2020, 3, 27, 17, 16, 45]
ds.datetime()
# set datetime
ds.datetime(2020, 3, 27, 17, 16, 45)# get temperature
ds.temp()
```## Notice
The `build/ds3231.mpy` is a compiled bytecode file, and only can be used in `MicroPython v1.12+` .
## Author
**esp-ds3231-micropython** © [HAIZAKURA](https://nya.run), Released under the [MIT](./LICENSE) License.
> [Personal Website](https://nya.run) · GitHub [@HAIZAKURA](https://github.com/HAIZAKURA) · Twitter [@haizakura_0v0](https://twitter.com/haizakura_0v0) · Telegram [@haizakura](https://t.me/haizakura)