Ai
8 Star 106 Fork 48

YuHong-LDU/Python-RaspberryPI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
light.py 400 Bytes
一键复制 编辑 原始数据 按行查看 历史
YuHong-LDU 提交于 2022-07-25 18:45 +08:00 . 代码
import RPi.GPIO as GPIO
class light():
def __init__(self,pin):
# 初始化
self.pin = pin
GPIO.setmode(GPIO.BOARD)
GPIO.setup(self.pin,GPIO.OUT)
GPIO.output(self.pin,GPIO.LOW)
def on(self):
GPIO.output(self.pin,GPIO.HIGH)
def off(self):
GPIO.output(self.pin,GPIO.LOW)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yuhong-ldu/python-raspberry-pi.git
git@gitee.com:yuhong-ldu/python-raspberry-pi.git
yuhong-ldu
python-raspberry-pi
Python-RaspberryPI
master

搜索帮助