【翻译】关于RTC时钟库Makuna/Rtc的中英文对照

https://github.com/Makuna/Rtc
Arduino Library for RTC, Ds1302, Ds1307, Ds3231, & Ds3234 with deep support.
Home · Makuna/Rtc Wiki · GitHub
Please consider donating to the cause.

请考虑捐赠给这一事业。

For quick questions jump on Gitter and ask away.

对于快速的问题,跳上吉特,然后问出去。

1.Overview 概述

This is an Arduino Library that has deep support for Real Time Clock modules.

这是一个Arduino库,它对实时时钟模块有很深的支持。

Please see the FAQ for common questions and answers.

请参阅常见问题解答。.

2. Supported RTC chip sets 支持的RTC芯片组

2.1 DS1302

Full support including burst mode use and charging settings

完全支持,包括突发模式使用和充电设置。

2.1 DS1307

Full support including squarewave output pin and memory access

完全支持,包括方波输出引脚和内存访问

2.1 DS3231

Full support including squarewave output pin and alarms. Memory access to at24cXX that is often included on modules is also supported through a separate object.

完全支持,包括方波输出引脚和警报器。模块中经常包含的对24 cXX的内存访问也通过一个单独的对象得到支持。

2.1 DS3234

Full support including squarewave output pin, alarms, and memory access. > > 完全支持,包括方波输出引脚,警报和内存访问。
Examples
实例

There are several examples that will help you get started. They range from simple to complex and are always a good reference.

有几个例子将帮助您开始。它们从简单到复杂,总是一个很好的参考。
Connecting the Devices 连接器件

The RTC devices expose either i2c, SPI, or a ThreeWire interface. I2c uses two digital connections labeled SDA and SCL. SPI uses four digital connections labeled MISO, MOSI, CLK, CS (SS). ThreeWire uses three digital connections labeled SCLK(CLK), IO (DAT), CE (RST). These need to be connected to the PINs exposed by your Arduino board labeled the same way. This varies from board to board so you will need to consult the Arduino reference documents for which pins are the SDA and SCL.

RTC设备公开i2c、SPI或ThreeWire接口。I2C使用两个标记为SDA和SCL的数字连接。SPI使用标记为MISO、MOSI、CLK、CS(SS)的四个数字连接。ThreeWire使用三个标记为SCLK(CLK)、IO(DAT)、CE(RST)的数字连接。这些需要连接到由您的Arduino板暴露的PIN标签相同的方式。这一点因板而异,因此您需要参考Arduino参考文件其中的引脚是SDA和SCL。

For ESP8266, I2C default to SDA = GPIO04 (D2) and SCL = GPIO05 (D1); but check with your specific board.

对于ESP 8266,I2C默认为SDA=GPIO 04(D2)和SCL=GPIO 05(D1);但请与您的特定板检查。

For ESP8266, SPI default to MISO = GPIO12 (D6), MOSI = GPIO13 (D7), and CLK = GPIO14 (D5); with CS (SS) set to any open pin; but check with your specific board.

对于ESP 8266,SPI默认为MISO=GPIO 12(D6)、MOSI=GPIO 13(D7)和CLK=GPIO 14(D5);CS(SS)设置为任何打开引脚;但请与您的特定板检查。

The RTC devices also require power. Make sure that VCC is connected to the proper voltage that your device requires. DS1307 requires 5v while the DS1302, DS3231 and DS3234 can use either 3.3v or 5v. The GND must be connected to the Arduino GND even if you are not powering the RTC from the Arduino voltage pins.

RTC设备也需要电力。确保VCC连接到设备所需的适当电压。DS 1307需要5v,而DS 1302、DS 3231和DS 3234可以使用3.3V或5v。GND必须连接到Arduino GND,即使您没有从Arduino电压引脚为RTC供电。

3. RtcDateTime object

RtcDateTime对象

This object will be used to get and set the date and time. It supports being constructed with various time formats from strings to standard Epoch time formats. It also supports access to individual date and time value for year, month, day, hour, minute, and seconds. 此对象将用于获取和设置日期和时间。它支持用各种时间格式(从字符串到标准的Epoch时间格式)构建。它还支持访问年、月、日、小时、分钟和秒的单个日期和时间值。

4. RtcTemperature object

RtcTemperature对象

This object will be used to get the temperature from the RTC module if it supports it. 该对象将用于从RTC模块获得温度,如果它支持它的话。

5. RtcDS1302 object

RtcDS 1302对象

This object will expose the features of the DS1302 RTC chip including a ThreeWire support class. 该对象将公开DS 1302 RTC芯片的特性,包括一个ThreeWire支持类。

5. RtcDS1307 object

RtcDS 1307对象

This object will expose the features of the DS1307 RTC chip including access to the onboard memory. 该对象将公开DS 1307 RTC芯片的特性,包括对车载内存的访问。

7. RtcDS3231 object

RtcDS 3231对象

This object will expose the features of the DS3231 RTC chip including access to the two alarm features. 该对象将公开DS 3231 RTC芯片的特性,包括对这两个报警功能的访问。

8. EepromAT24C32 object

EepromAT24C32对象

This object will expose the features of the at24cxx eeprom chip that is often included on the DS3231 modules. 此对象将公开常包含在DS 3231模块上的at24cxx EEPROM芯片的特性。

3.RtcDateTime object

RtcDateTime object

RtcDateTime对象。

Michael Miller edited this page on 9 Mar 2017 · 3 revisions

迈克尔·米勒于2017年3月9日编辑了这一页面·3次修改。

(under construction) (在建)。
RtcDateTime represents the time and date in one object. It is used to retrieve and set the time on the Rtc objects.

RtcDateTime表示一个对象中的时间和日期。它用于检索和设置RTC对象的时间。

1. Constructors 结构。

RtcDateTime(uint32_t secondsFrom2000)
Construct the RtcDateTime from seconds.

从秒构造RtcDateTime。

secondsFrom2000 - the number of seconds since Jan 1, 2000. This is not EPOCH date time.

从2000年开始的秒数-自2000年1月1日以来的秒数。这不是纪元日期时间。

RtcDateTime(uint16_t year, uint8_t month, uint8_t dayOfMonth, uint8_t hour, uint8_t minute, uint8_t second)
Construct the RtcDateTime from individual values of the date and time.

从日期和时间的各个值构造RtcDateTime。

RtcDateTime(const char* date, const char* time) 。
Construct the RtcDateTime from the compilation format of date and time

从日期和时间的编译格式构造RtcDateTime。

RtcDateTime compileDateTime(__DATE__, __TIME__);	

2. Properties 特性。

  1. uint16_t Year() const
    , the four digit year

返回>;,四位数的年份。

  1. uint8_t Month() const
    , the month

返回>;,月份。

  1. uint8_t Day() const
    , the month

返回>;,月份。

  1. uint8_t Hour() const
    , the hour, in 24 hours format

返回>;,时间,24小时格式。

  1. uint8_t Minute() const
    , the minutes

返回>;,分钟。

  1. uint8_t Second() const
    , the seconds

返回>;,秒数。

  1. uint8_t DayOfWeek() const
    , the day of the week, where the day of the week starts on Sunday with a value of 0.

返回;,一周中的一天从周日开始,值为0。

3. Operators 操作符。

void operator += (uint32_t seconds)
This allows for seconds to added to the time.

这允许将秒添加到时间中。

time += 60; // add a minute

时间 +=60;/添加一分钟。

4. Methods 方法

  1. uint32_t TotalSeconds() const
    , the total seconds since 1/1/2000. This is not EPOCH time.

返回>;,自1/1/2000以来的总秒数。这不是纪元时代。

  1. uint64_t TotalSeconds64() const;
    , the total seconds since 1/1/2000. This is not EPOCH time.

返回;,自1/1/2000以来的总秒数。这不是纪元时代。

  1. uint32_t Epoch32Time() const
    , an EPOCH time value.

返回>;一个纪元时间值。

  1. void InitWithEpoch32Time(uint32_t time)
    time - a time value in 32 bit EPOCH time space.

时间-以32位纪元时间空间为单位的时间值。

  1. uint64_t Epoch64Time() const
    , an EPOCH time value.

返回;,一个纪元时间值。

  1. void InitWithEpoch64Time(uint64_t time)
    time - a time value in 64 bit EPOCH time space.

Time-以64位纪元时间空间为单位的时间值。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值