rv3032c7_pi
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rv3032c7_pi [2025/02/01 05:20] – [Directly] admin | rv3032c7_pi [2025/02/01 05:21] (current) – [Install Requirements] admin | ||
---|---|---|---|
Line 15: | Line 15: | ||
'' | '' | ||
===== Install Requirements ===== | ===== Install Requirements ===== | ||
- | < | ||
- | sudo apt-get install python-smbus i2c-tools | ||
- | </ | ||
+ | '' | ||
===== Confirm Presence ===== | ===== Confirm Presence ===== | ||
< | < | ||
Line 63: | Line 61: | ||
</ | </ | ||
+ | ====== dmesg ====== | ||
+ | < | ||
+ | $ sudo dmesg | grep rtc | ||
+ | [ 2.837650] rtc-rv3032 1-0051: registered as rtc0 | ||
+ | [ 2.839127] rtc-rv3032 1-0051: setting system clock to 2025-02-01T05: | ||
+ | </ | ||
===== Disable Fake hwclock ===== | ===== Disable Fake hwclock ===== | ||
Line 129: | Line 133: | ||
21312</ | 21312</ | ||
- | ===== Python ===== | ||
- | < | ||
- | import smbus | ||
- | import os | ||
- | |||
- | bus = smbus.SMBus(1) | ||
- | address = 0x68 | ||
- | |||
- | os.system(' | ||
- | def getTemp(address): | ||
- | | ||
- | | ||
- | | ||
- | |||
- | #print getTemp(address) | ||
- | Celsius = getTemp(address) | ||
- | Fahrenheit = 9.0/5.0 * Celsius + 32 | ||
- | print Fahrenheit, "*F /", Celsius, " | ||
- | os.system(' | ||
- | </ | ||
- | |||
- | Save as a .py file (e.g. ds3231_temp.py) and run with '' | ||
- | |||
- | You may need to install '' | ||
rv3032c7_pi.1738387219.txt.gz · Last modified: 2025/02/01 05:20 by admin