{ "info": { "author": "Adafruit Industries", "author_email": "circuitpython@adafruit.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries", "Topic :: System :: Hardware" ], "description": "\ufeffIntroduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-micropython-ds3231/badge/?version=latest\n :target: https://circuitpython.readthedocs.io/projects/ds3231/en/latest/\n :alt: Documentation Status\n\n.. image :: https://img.shields.io/discord/327254708534116352.svg\n :target: https://discord.gg/nBQh6qu\n :alt: Discord\n\n.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_DS3231.svg?branch=master\n :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_DS3231\n :alt: Build Status\n\nThe datasheet for the DS3231 explains that this part is an\n\"Extremely Accurate I\u00b2C-Integrated RTC/TCXO/Crystal\". And,\nhey, it does exactly what it says on the tin! This Real Time\nClock (RTC) is the most precise you can get in a small, low\npower package.\n\nMost RTCs use an external 32kHz timing crystal that is used\nto keep time with low current draw. And that's all well and\ngood, but those crystals have slight drift, particularly when\nthe temperature changes (the temperature changes the oscillation\nfrequency very very very slightly but it does add up!) This\nRTC is in a beefy package because the crystal is inside the\nchip! And right next to the integrated crystal is a temperature\nsensor. That sensor compensates for the frequency changes by\nadding or removing clock ticks so that the timekeeping stays\non schedule.\n\nThis is the finest RTC you can get, and now we have it in a\ncompact, breadboard-friendly breakout. With a coin cell\nplugged into the back, you can get years of precision\ntimekeeping, even when main power is lost. Great for\ndatalogging and clocks, or anything where you need to\nreally know the time.\n\n.. image:: ../docs/_static/3013-01.jpg\n :alt: DS3231 Product Image\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython `_\n* `Bus Device `_\n* `Register `_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle `_.\n\nUsage Notes\n===========\n\nBasics\n------\n\nOf course, you must import the library to use it:\n\n.. code:: python\n\n import busio\n import adafruit_ds3231\n import time\n\nAll the Adafruit RTC libraries take an instantiated and active I2C object\n(from the ``busio`` library) as an argument to their constructor. The way to\ncreate an I2C object depends on the board you are using. For boards with labeled\nSCL and SDA pins, you can:\n\n.. code:: python\n\n from board import *\n\nYou can also use pins defined by the onboard ``microcontroller`` through the\n``microcontroller.pin`` module.\n\nNow, to initialize the I2C bus:\n\n.. code:: python\n\n myI2C = busio.I2C(SCL, SDA)\n\nOnce you have created the I2C interface object, you can use it to instantiate\nthe RTC object:\n\n.. code:: python\n\n rtc = adafruit_ds3231.DS3231(myI2C)\n\nDate and time\n-------------\n\nTo set the time, you need to set ``datetime`` to a ``time.struct_time`` object:\n\n.. code:: python\n\n rtc.datetime = time.struct_time((2017,1,9,15,6,0,0,9,-1))\n\nAfter the RTC is set, you retrieve the time by reading the ``datetime``\nattribute and access the standard attributes of a struct_time such as ``tm_year``,\n``tm_hour`` and ``tm_min``.\n\n.. code:: python\n\n t = rtc.datetime\n print(t)\n print(t.tm_hour, t.tm_min)\n\nAlarm\n-----\n\nTo set the time, you need to set ``alarm1`` or ``alarm2`` to a tuple with a\n``time.struct_time`` object and string representing the frequency such as \"hourly\":\n\n.. code:: python\n\n rtc.alarm1 = (time.struct_time((2017,1,9,15,6,0,0,9,-1)), \"daily\")\n\nAfter the RTC is set, you retrieve the alarm status by reading the corresponding\n``alarm1_status`` or ``alarm2_status`` attributes. Once True, set it back to False\nto reset.\n\n.. code:: python\n\n if rtc.alarm1_status:\n print(\"wake up!\")\n rtc.alarm1_status = False\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n`_\nbefore contributing to help this project stay welcoming.\n\nBuilding locally\n================\n\nTo build this library locally you'll need to install the\n`circuitpython-build-tools `_ package.\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install circuitpython-build-tools\n\nOnce installed, make sure you are in the virtual environment:\n\n.. code-block:: shell\n\n source .env/bin/activate\n\nThen run the build:\n\n.. code-block:: shell\n\n circuitpython-build-bundles --filename_prefix adafruit-circuitpython-ds3231 --library_location .\n\nSphinx documentation\n-----------------------\n\nSphinx is used to build the documentation based on rST files and comments in the code. First,\ninstall dependencies (feel free to reuse the virtual environment from above):\n\n.. code-block:: shell\n\n python3 -m venv .env\n source .env/bin/activate\n pip install Sphinx sphinx-rtd-theme\n\nNow, once you have the virtual environment activated:\n\n.. code-block:: shell\n\n cd docs\n sphinx-build -E -W -b html . _build/html\n\nThis will output the documentation to ``docs/_build/html``. Open the index.html in your browser to\nview them. It will also (due to -W) error out on any warning like Travis will. This is a good way to\nlocally verify it will pass.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adafruit/Adafruit_CircuitPython_DS3231", "keywords": "adafruit precision real-time real time clock breakout hardware micropython circuitpython", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "adafruit-circuitpython-ds3231", "package_url": "https://pypi.org/project/adafruit-circuitpython-ds3231/", "platform": "", "project_url": "https://pypi.org/project/adafruit-circuitpython-ds3231/", "project_urls": { "Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_DS3231" }, "release_url": "https://pypi.org/project/adafruit-circuitpython-ds3231/2.1.3/", "requires_dist": null, "requires_python": "", "summary": "CircuitPython library for DS3231 precision real-time clock.", "version": "2.1.3" }, "last_serial": 4701249, "releases": { "2.1.0": [ { "comment_text": "", "digests": { "md5": "224cbe9d062a283db9b8e047e9c4f9ab", "sha256": "03b0977510aaf40851b064e3e23e287dff309bf78daf98e53b16aee2580db0b5" }, "downloads": -1, "filename": "adafruit-circuitpython-ds3231-2.1.0.tar.gz", "has_sig": false, "md5_digest": "224cbe9d062a283db9b8e047e9c4f9ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 291452, "upload_time": "2018-08-05T16:31:25", "url": "https://files.pythonhosted.org/packages/4e/f2/ecae340be2d9357fa9dfb5d733b2622e2d20963e0ff1938dead74add0b54/adafruit-circuitpython-ds3231-2.1.0.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "0bbbf9bfaeeccb9ba0cfd5eb82b4d72c", "sha256": "ca1cf3a219e1e2522df10cbe305ad257383e5c0e49f126d1d8bf3d8b0b9e012a" }, "downloads": -1, "filename": "adafruit-circuitpython-ds3231-2.1.1.tar.gz", "has_sig": false, "md5_digest": "0bbbf9bfaeeccb9ba0cfd5eb82b4d72c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 291461, "upload_time": "2018-11-12T20:29:39", "url": "https://files.pythonhosted.org/packages/13/89/cfc1eea0ff10fb54896c697ddcd7365d92c5c80d61fa0d358ea31bfeaae5/adafruit-circuitpython-ds3231-2.1.1.tar.gz" } ], "2.1.2": [ { "comment_text": "", "digests": { "md5": "fd269462cdffd626958ccdffb7961f00", "sha256": "19fdb2452182278f718d6326b66d53d60ecf2db9efead494d9c2ff51acec75d7" }, "downloads": -1, "filename": "adafruit-circuitpython-ds3231-2.1.2.tar.gz", "has_sig": false, "md5_digest": "fd269462cdffd626958ccdffb7961f00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 291470, "upload_time": "2018-12-03T22:04:03", "url": "https://files.pythonhosted.org/packages/84/03/a4970bd804d08ab601868ff785fd51c846e4f0d7a4f40a87947dc85eb891/adafruit-circuitpython-ds3231-2.1.2.tar.gz" } ], "2.1.3": [ { "comment_text": "", "digests": { "md5": "188218c71f23ff1039c6223071ee920a", "sha256": "d6aafdf753ed77446a852e1bac139ce8b1e2b3996b941799294ee4bcf0e68137" }, "downloads": -1, "filename": "adafruit-circuitpython-ds3231-2.1.3.tar.gz", "has_sig": false, "md5_digest": "188218c71f23ff1039c6223071ee920a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 288371, "upload_time": "2019-01-16T02:30:39", "url": "https://files.pythonhosted.org/packages/c7/d0/ef6e35191a5262e92eaae71404a34922a098c0a2e586b02225aa42018a3d/adafruit-circuitpython-ds3231-2.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "188218c71f23ff1039c6223071ee920a", "sha256": "d6aafdf753ed77446a852e1bac139ce8b1e2b3996b941799294ee4bcf0e68137" }, "downloads": -1, "filename": "adafruit-circuitpython-ds3231-2.1.3.tar.gz", "has_sig": false, "md5_digest": "188218c71f23ff1039c6223071ee920a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 288371, "upload_time": "2019-01-16T02:30:39", "url": "https://files.pythonhosted.org/packages/c7/d0/ef6e35191a5262e92eaae71404a34922a098c0a2e586b02225aa42018a3d/adafruit-circuitpython-ds3231-2.1.3.tar.gz" } ] }