Find file History

Slight modification to the ds1302.c shipped with WiringPi to work better with the DS1302 Real-Time Clock module.

Usage instruction:

  • ./ the date & time stored in DS1302 module
  • ./ rtest:test whether the DS1302 module works fine
  • ./ sdsc:write OS time into the DS1302 module
  • ./ slc:write the time stored in DS1302 module into OS
  • ./ slc b:same effect as above command, especially that it's for RPi model B(default model B+ if no 2nd param provided)

对WiringPi附带的 ds1302.c 做了少量修改,使其更好地配合 DS1302 实时时钟(硬件时钟)模块工作。


  • ./打印出 DS1302 模块中存储的时间
  • ./ rtest:测试 DS1302 模块是否工作正常
  • ./ sdsc:将Linux系统时间写入 DS1302 模块中
  • ./ slc:将 DS1302 模块中的时间写入Linux系统
  • ./ slc b:与上面命令效果相同,但只适用于树莓派model B(如果不提供第2个参数的话默认是model B+)