Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Python module to deal with DS1302 RTC chip on Raspberry Pi

License

NotificationsYou must be signed in to change notification settings

sourceperl/rpi.rtc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Python module to deal with DS1302 RTC on Raspberry Pi

Wire map (default conf.)

ChipRpi pin
VCC3.3v pin
GNDGND pin
CLKpin 11
DATApin 13
CE (RST)pin 15

Setup

sudo apt-get -y install python3-rpi.gpiosudo python3 setup.py install

Read RTC chip date and time

ds1302_get_utc

RPi date and time (UTC) to RTC chip

ds1302_set_utc

Update Rpi system time from RTC chip

Typically call at RPi startup

sudo date -s `./ds1302_get_utc`

One line to check RTC chip time vs system time

Since RTC store only second and not millisecond a 1s delta can occur (or more after a few days)

# drift in secondecho $(($(date -u -d`ds1302_get_utc` +%s) - $(date -u +%s)))# human readableecho "RTC `ds1302_get_utc`"; echo "SYS `date --utc +%FT%TZ`";

About

A Python module to deal with DS1302 RTC chip on Raspberry Pi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp