|
|
第 3 行: |
第 3 行: |
| {| border="0" cellpadding="10" width="100%" | | {| border="0" cellpadding="10" width="100%" |
| |- | | |- |
− | |width="30%" valign="top" align="left"| | + | |width="90%" valign="top" align="left"| |
| | | |
| RTC_DS1307_DS3231库 -- arduino实时时钟库(已支持ESP8266) | | RTC_DS1307_DS3231库 -- arduino实时时钟库(已支持ESP8266) |
第 34 行: |
第 34 行: |
| |width="10%" valign="top" align="left"| | | |width="10%" valign="top" align="left"| |
| <!-- 空白 --> | | <!-- 空白 --> |
| + | |} |
| | | |
− | |width="30%" valign="top" align="left"| | + | {| border="0" cellpadding="10" width="100%" |
− | <br><br><br>
| + | |- |
| + | |width="50%" valign="top" align="left"| |
| | | |
| <font color="orange" size="+2">'''DS1307'''</font><br> | | <font color="orange" size="+2">'''DS1307'''</font><br> |
第 60 行: |
第 62 行: |
| :-[[RtcDS1307.SetSquareWavePin()| SetSquareWavePin()]] | | :-[[RtcDS1307.SetSquareWavePin()| SetSquareWavePin()]] |
| | | |
− | <br><br>
| + | |width="50%" valign="top" align="left"| |
| + | |
| <font color="orange" size="+2">'''DS3231'''</font><br> | | <font color="orange" size="+2">'''DS3231'''</font><br> |
| | | |
2016年12月26日 (一) 08:55的修訂版本
RTC_DS1307_DS3231庫 -- arduino實時時鐘庫(已支持ESP8266)
GITHUB 工程地址:RTC by Makuna
支持設備
DS1307
Full support including squarewave output pin and memory access -- 全部功能支持,包括方波輸出和內存訪問
DS3231
Full support including squarewave output pin and alarms. -- 全部功能支持,包括方波輸出和鬧鐘
示例
- - DS1307_Memory: This demonstrates how to write and read data from the extended memory of the device. This memory is retained even after the device has lost power./演示如何讀寫數據從設備的擴展內存。即使設備掉電內存依然保存
- - DS1307_Simple: This demonstrates how to set and get the date and time from the device./演示了如何在設備上設置和獲取日期和時間
- - DS3231_Alarms: This demonstrates how to set the alarms and check when the alarms are triggered. This includes using the squarewave output to trigger an interrupt./演示如何設置鬧鐘和檢查何時觸發鬧鐘。這包含使用方波輸出觸發一個中斷
- - DS3231_Simple: This demonstrates how to set and get the date and time from the device./演示如何在設備上設置和獲取日期和時間。
- - DS3231_StoreIt: This demonstrates how to turn off the Rtc clock so that the onboard battery will last longer./演示如何關閉RTC時鐘以保證板載電池能持續更長時間
|
|
DS1307
DS1307 函數。
- - Begin() -- 初始化
- 參數:無
- 返回:無
- - GetIsRunning()
- - SetIsRunning()
- - SetDateTime()
- - GetDateTime()
- - SetMemory()
- - GetMemory()
- - SetSquareWavePin()
|
DS3231
DS3231 函數
- - Begin() -- 初始化
- 參數:無
- 返回:無
- -IsDateTimeValid() -- 檢查日期時間是否有效
- 參數:無
- 返回:bool
- - GetIsRunning()
- - SetIsRunning()
- -SetDateTime() -- 設置日期時間
- 參數:const RtcDateTime& dt
- 返回:無
- -GetDateTime() -- 獲取日期時間
- 參數:無
- 返回:RtcDateTime
- -GetTemperature() -- 獲取溫度
- 參數:無
- 返回:RtcTemperature
- -Enable32kHzPin() -- 使能32KHZ引腳
- 參數:bool enable
- 返回:無
- -SetSquareWavePin() -- 設置方波輸出引腳
- 參數:DS3231SquareWavePinMode pinMode
enum DS3231SquareWavePinMode{
DS3231SquareWavePin_ModeNone,
DS3231SquareWavePin_ModeBatteryBackup,
DS3231SquareWavePin_ModeClock,
DS3231SquareWavePin_ModeAlarmOne,
DS3231SquareWavePin_ModeAlarmTwo,
DS3231SquareWavePin_ModeAlarmBoth
}
- 返回:無
- -SetSquareWavePinClockFrequency() -- 設置方波輸出引腳時鐘頻率
- 參數:DS3231SquareWaveClock freq
- 返回:無
- -SetAlarmOne() -- 設置鬧鐘1
- 參數:const DS3231AlarmOne& alarm
- 返回:無
- -SetAlarmTwo() -- 設置鬧鐘2
- 參數:const DS3231AlarmTwo& alarm
- 返回:無
- -GetAlarmOne() -- 獲取鬧鐘1
- 參數:無
- 返回:DS3231AlarmOne
- -GetAlarmTwo() -- 獲取鬧鐘2
- 參數:無
- 返回:DS3231AlarmTwo
- -LatchAlarmsTriggeredFlags() -- 警報後必須調用,否則將不會再次觸發
- 參數:無
- 返回:DS3231AlarmFlag
- -ForceTemperatureCompensationUpdate() -- 手動溫度補償更新
- 參數:bool block
- 返回:無
- -GetAgingOffset() -- 獲取老化補償
- 參數:無
- 返回:int8_t
- -SetAgingOffset() -- 設置老化補償
- 參數:int8_t
- 返回:無
|
|
TIP: 宏:__DATE__,__TIME__,__FILE__,__LINE__
返回DS1307
返回DS3231
返回Arduino庫菜單
返回首頁
更多建議和問題歡迎反饋至 YFRobot論壇