Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattytrentini/micropython-mcp7940
A MicroPython driver for the Microchip MCP7940 RTC chip
https://github.com/mattytrentini/micropython-mcp7940
Last synced: 3 months ago
JSON representation
A MicroPython driver for the Microchip MCP7940 RTC chip
- Host: GitHub
- URL: https://github.com/mattytrentini/micropython-mcp7940
- Owner: mattytrentini
- License: mit
- Created: 2019-06-20T12:44:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-14T23:40:55.000Z (over 5 years ago)
- Last Synced: 2024-04-22T12:33:30.433Z (7 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 9
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - micropython-mcp7940 - Driver for the Microchip MCP7940 RTC. (Libraries / Communications)
README
# MicroPython-MCP7940
A MicroPython driver for the Microchip MCP7940 RTC chip## Example usage
```python
import mcp7940
from machine import Pin, I2C
import utime as timei2c = I2C(sda=Pin(21), scl=Pin(22)) # Correct I2C pins for TinyPICO
mcp = mcp7940.MCP7940(i2c)mcp.time # Read time
mcp.time = time.localtime() # Set time
mcp.start() # Start MCP oscillator
mcp.time # Read time after setting it, repeat to see time incrementing
```