RTC (Real Time Clock) 可以幫助用戶快速查詢時間,對于時間敏感的應用是很有必要的
準備材料
RTL8722 x 1
范例說明
RTC 模組會幫助微控制器來追蹤時間,是時間模組必須的一部分。我們在這里有一個示例,來展示如何來得到本地時間和上傳時間。
復制下面的代碼貼至REPL,觀察結果。
rtc = RTC()
rtc.datetime() # get date and time
rtc.datetime((2020, 12, 31, 4, 23, 58, 59, 0)) # set a specific date and time (year, month, day, weekday(0 for Monday), hour, minute, second, total seconds)
rtc.datetime() # check the updated date and time
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/277902.html
標籤:單片機/工控
上一篇:[分享一下] 超聲波收發分體量尺(GPS / BDS芯片PPS訊號作為時間同步,同步誤差約十多微秒)
下一篇:關于opengl模板測驗的問題
