Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
my_xihale
Time
提交
350b8622
T
Time
项目概览
my_xihale
/
Time
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Time
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
350b8622
编写于
11月 09, 2016
作者:
P
PaulStoffregen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update readme
上级
22c59471
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
49 addition
and
45 deletion
+49
-45
Readme.txt
Readme.txt
+49
-45
未找到文件。
Readme.txt
浏览文件 @
350b8622
...
@@ -18,7 +18,7 @@ hour(); // the hour now (0-23)
...
@@ -18,7 +18,7 @@ hour(); // the hour now (0-23)
minute(); // the minute now (0-59)
minute(); // the minute now (0-59)
second(); // the second now (0-59)
second(); // the second now (0-59)
day(); // the day now (1-31)
day(); // the day now (1-31)
weekday(); // day of the week
, Sunday is day 0
weekday(); // day of the week
(1-7), Sunday is day 1
month(); // the month now (1-12)
month(); // the month now (1-12)
year(); // the full four digit year: (2009, 2010 etc)
year(); // the full four digit year: (2009, 2010 etc)
...
@@ -44,23 +44,26 @@ following functions eliminates this probglem
...
@@ -44,23 +44,26 @@ following functions eliminates this probglem
Functions for managing the timer services are:
Functions for managing the timer services are:
setTime(t); // set the system time to the give time t
setTime(hr,min,sec,day,mnth,yr); // alternative to above, yr is 2 or 4 digit yr (2010 or 10 sets year to 2010)
adjustTime(adjustment); // adjust system time by adding the adjustment value
timeStatus(); // indicates if time has been set and recently synchronized
setTime(t); // set the system time to the give time t
setTime(hr,min,sec,day,mnth,yr); // alternative to above, yr is 2 or 4 digit yr
// (2010 or 10 sets year to 2010)
adjustTime(adjustment); // adjust system time by adding the adjustment value
timeStatus(); // indicates if time has been set and recently synchronized
// returns one of the following enumerations:
// returns one of the following enumerations:
timeNotSet // the time has never been set, the clock started at Jan 1 1970
timeNotSet // the time has never been set, the clock started at Jan 1 1970
timeNeedsSync // the time had been set but a sync attempt did not succeed
timeNeedsSync // the time had been set but a sync attempt did not succeed
timeSet // the time is set and is synced
timeSet // the time is set and is synced
Time and Date values are not valid if the status is timeNotSet. Otherwise values can be used but
Time and Date values are not valid if the status is timeNotSet. Otherwise values can be used but
the returned time may have drifted if the status is timeNeedsSync.
the returned time may have drifted if the status is timeNeedsSync.
setSyncProvider(getTimeFunction); // set the external time provider
setSyncProvider(getTimeFunction); // set the external time provider
setSyncInterval(interval); // set the number of seconds between re-sync
setSyncInterval(interval); // set the number of seconds between re-sync
There are many convenience macros in the time.h file for time constants and conversion of time units.
There are many convenience macros in the time.h file for time constants and conversion
of time units.
To use the library, copy the download to the Library directory.
To use the library, copy the download to the Library directory.
...
@@ -84,7 +87,8 @@ illustrating how the library can be used with various time sources:
...
@@ -84,7 +87,8 @@ illustrating how the library can be used with various time sources:
- TimeRTCLog demonstrates how to calculate the difference between times.
- TimeRTCLog demonstrates how to calculate the difference between times.
It is a vary simple logger application that monitors events on digtial pins
It is a vary simple logger application that monitors events on digtial pins
and prints (to the serial port) the time of an event and the time period since the previous event.
and prints (to the serial port) the time of an event and the time period since
the previous event.
- TimeNTP uses the Arduino Ethernet shield to access time using the internet NTP time service.
- TimeNTP uses the Arduino Ethernet shield to access time using the internet NTP time service.
The NTP protocol uses UDP and the UdpBytewise library is required, see:
The NTP protocol uses UDP and the UdpBytewise library is required, see:
...
@@ -124,8 +128,8 @@ All the members of the Arduino tm structure are bytes and the year is offset fro
...
@@ -124,8 +128,8 @@ All the members of the Arduino tm structure are bytes and the year is offset fro
Convenience macros provide conversion to and from the Arduino format.
Convenience macros provide conversion to and from the Arduino format.
Low level functions to convert between system time and individual time elements are provided:
Low level functions to convert between system time and individual time elements are provided:
breakTime(
time, &tm); // break time_t into elements stored in tm struct
breakTime(time, &tm); // break time_t into elements stored in tm struct
makeTime(
&tm); // return time_t from elements stored in tm struct
makeTime(
&tm); // return time_t from elements stored in tm struct
The DS1307RTC library included in the download provides an example of how a time provider
The DS1307RTC library included in the download provides an example of how a time provider
can use the low level functions to interface with the Time library.
can use the low level functions to interface with the Time library.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录