跳转到主要内容

S-35710低功耗唤醒定时器的CircuitPython驱动程序

项目描述

简介

Documentation Status Discord Build Status Code Style: Black

S-35710低功耗唤醒定时器的CircuitPython驱动程序

依赖项

此驱动程序依赖于

请确保所有依赖项都在CircuitPython文件系统中可用。这可以通过下载 Adafruit库和驱动程序包 或使用 circup 安装单个库轻松实现。

从Adafruit商店购买一个

从PyPI安装

在支持GNU/Linux系统(如Raspberry Pi)上,您可以从PyPI本地安装驱动程序。要为当前用户安装

pip3 install adafruit-circuitpython-s35710

要系统性地安装(在某些情况下可能需要)

sudo pip3 install adafruit-circuitpython-s35710

要在当前项目的虚拟环境中安装

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install adafruit-circuitpython-s35710

使用Circup在连接的CircuitPython设备上安装

确保您已将circup安装到Python环境中。如果需要,可以使用以下命令安装它

pip3 install circup

安装circup后,将CircuitPython设备连接,使用以下命令安装

circup install adafruit_s35710

或使用以下命令更新现有版本

circup update

使用示例

import time
import board
import adafruit_s35710

i2c = board.I2C()

timer = adafruit_s35710.Adafruit_S35710(i2c)

timer.alarm = 5
print(f"The S-35710 alarm is set for {timer.alarm} seconds")

countdown = timer.alarm - timer.clock

while True:
    print(f"The S-35710 clock is {timer.clock}")
    countdown = timer.alarm - timer.clock
    if countdown == 0:
        timer.alarm = 5
        print("Alarm reached! Resetting..")
    else:
        print(f"The alarm will expire in {countdown} seconds")
    time.sleep(1)

文档

本库的API文档可以在Read the Docs上找到。

有关构建库文档的信息,请参阅本指南

贡献

欢迎贡献力量!在贡献之前,请阅读我们的行为准则,以帮助本项目保持友好。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源码分布

adafruit_circuitpython_s35710-1.0.0.tar.gz (26.5 kB 查看哈希值)

上传时间 源码

构建分布

adafruit_circuitpython_s35710-1.0.0-py3-none-any.whl (4.9 kB 查看哈希值)

上传时间 Python 3

由以下机构支持