{"id":13894143,"url":"https://github.com/Seeed-Studio/Seeed_Arduino_RTC","last_synced_at":"2025-07-17T08:32:37.113Z","repository":{"id":53071992,"uuid":"280069901","full_name":"Seeed-Studio/Seeed_Arduino_RTC","owner":"Seeed-Studio","description":"When your project needs to be unplugged, how to keep the time counting? This library can help you set up the current time.","archived":false,"fork":false,"pushed_at":"2021-04-08T00:41:16.000Z","size":44,"stargazers_count":8,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-07T18:27:43.043Z","etag":null,"topics":["ds1307","grove","grovelibrary","rtc"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seeed-Studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-16T06:12:26.000Z","updated_at":"2024-07-23T07:06:44.000Z","dependencies_parsed_at":"2022-08-30T18:21:49.666Z","dependency_job_id":null,"html_url":"https://github.com/Seeed-Studio/Seeed_Arduino_RTC","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2FSeeed_Arduino_RTC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2FSeeed_Arduino_RTC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2FSeeed_Arduino_RTC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2FSeeed_Arduino_RTC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seeed-Studio","download_url":"https://codeload.github.com/Seeed-Studio/Seeed_Arduino_RTC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226243893,"owners_count":17594452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ds1307","grove","grovelibrary","rtc"],"created_at":"2024-08-06T18:01:24.949Z","updated_at":"2024-11-24T22:31:18.712Z","avatar_url":"https://github.com/Seeed-Studio.png","language":"C++","readme":"# Seeed_Arduino_RTC  [![Build Status](https://travis-ci.com/Seeed-Studio/Seeed_Arduino_RTC.svg?branch=master)](https://travis-ci.com/Seeed-Studio/Seeed_Arduino_RTC)\n## Introduction \nSeeed Arduino RTC is a Arduino library for RTC Moudle. At present, samd21 is supported and samd51 has built-in RTC module. \n## How to install  Arduino Library\nplease refer [here](https://wiki.seeedstudio.com/How_to_install_Arduino_Library/).\n\n## Usage\n\n```C++\n#include \"RTC_SAMD21.h\"\n#include \"DateTime.h\"\n\nRTC_SAMD21 rtc;\nvoid setup()\n{\n    rtc.begin();\n\n    Serial.begin(115200);\n\n    while (!Serial)\n    {\n        ;\n    }\n    \n    DateTime now = DateTime(F(__DATE__), F(__TIME__));\n    Serial.println(\"adjust time!\");\n    rtc.adjust(now);\n\n    now = rtc.now();\n\n    Serial.print(now.year(), DEC);\n    Serial.print('/');\n    Serial.print(now.month(), DEC);\n    Serial.print('/');\n    Serial.print(now.day(), DEC);\n    Serial.print(\" \");\n    Serial.print(now.hour(), DEC);\n    Serial.print(':');\n    Serial.print(now.minute(), DEC);\n    Serial.print(':');\n    Serial.print(now.second(), DEC);\n    Serial.println();\n\n}\nvoid loop()\n{\n    now = rtc.now();\n\n    Serial.print(now.year(), DEC);\n    Serial.print('/');\n    Serial.print(now.month(), DEC);\n    Serial.print('/');\n    Serial.print(now.day(), DEC);\n    Serial.print(\" \");\n    Serial.print(now.hour(), DEC);\n    Serial.print(':');\n    Serial.print(now.minute(), DEC);\n    Serial.print(':');\n    Serial.print(now.second(), DEC);\n    Serial.println();\n\n}\n\n```\n\n## API Reference\n- **begin(*void*) : bool**\n```C++\nrtc.begin()\n```\n- **now(*void*) : DateTime**\n```C++\nDateTime now = rtc.now();\n```\n- **adjust(*const DateTime*) : void**\n```C++\nDateTime now = DateTime(F(__DATE__), F(__TIME__));\nrtc.adjust(now);\nDateTime now = DateTime(2020, 7, 15, 0, 0, 0);\nrtc.adjust(now);\n```\n- **setAlarm(*const DateTime*) : void**\n```C++\nDateTime alarm = DateTime(2020, 7, 15, 18, 0, 0);\nrtc.setAlarm(now);\n```\n- **alarm(*void*) : DateTime**\n```C++\nDateTime now = rtc.alarm();\n```\n- **disableAlarm(*uint8_t*) : void**\n```C++\nrtc.disableAlarm(0);\n```\n- **enableAlarm(*uint8_t*) : void**\n```C++\nrtc.enableAlarm(0);\n```\n- **attachInterrupt(*rtcCallBack*) : void**\n```C++\nrtc.attachInterrupt(rtcCallBack);\n```\n- **detachInterrupt(*void*) : void**\n```C++\nrtc.detachInterrupt();\n```\n\n----\n## License\nThis software is written by seeed studio\u003cbr\u003e\nand is licensed under [The MIT License](http://opensource.org/licenses/mit-license.php). Check License.txt for more information.\u003cbr\u003e\n\nContributing to this software is warmly welcomed. You can do this basically by\u003cbr\u003e\n[forking](https://help.github.com/articles/fork-a-repo), committing modifications and then [pulling requests](https://help.github.com/articles/using-pull-requests) (follow the links above\u003cbr\u003e\nfor operating guide). Adding change log and your contact into file header is encouraged.\u003cbr\u003e\nThanks for your contribution.\n\nSeeed Studio is an open hardware facilitation company based in Shenzhen, China. \u003cbr\u003e\nBenefiting from local manufacture power and convenient global logistic system, \u003cbr\u003e\nwe integrate resources to serve new era of innovation. Seeed also works with \u003cbr\u003e\nglobal distributors and partners to push open hardware movement.\u003cbr\u003e","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeeed-Studio%2FSeeed_Arduino_RTC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSeeed-Studio%2FSeeed_Arduino_RTC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSeeed-Studio%2FSeeed_Arduino_RTC/lists"}