NTPClock.py 736 B

1234567891011121314151617181920212223242526
  1. """
  2. NTPClock.py
  3. Pico W/Pico2 Wを利用したNTP時計のメインプログラム。
  4. """
  5. from Debug import Debug
  6. from NTPSource import NTPSource
  7. from RTCClockApp import RTCClockApp
  8. from tm1637 import TM1637
  9. # 設定ファイル
  10. from NTP_CONFIG import NTP_CONFIG
  11. # 表示器
  12. disp = TM1637(sda_pin=NTP_CONFIG["tm1637_sda_pin"],contrast=4)
  13. # NTP時刻ソース
  14. ntp = NTPSource(NTP_CONFIG["ssid"], NTP_CONFIG["pass"],sync_indicator_pin=NTP_CONFIG["sync_indicator_pin"])
  15. # 時計アプリケーションクラス
  16. app = RTCClockApp(disp, ntp, ntp,
  17. mode_select_pin=NTP_CONFIG["mode_select_pin"],
  18. force_sync_pin=NTP_CONFIG["force_sync_pin"])
  19. # 時計スタート
  20. app.run()
  21. # 終了処理
  22. disp.release()