From f4a15b69fc71eede123977a6ae159ad0e2f33c3e Mon Sep 17 00:00:00 2001 From: pxnmejity <2281039978@qq.com> Date: Thu, 26 Dec 2024 14:11:38 +0800 Subject: [PATCH] Delete 'lighting.py' --- lighting.py | 90 ----------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 lighting.py diff --git a/lighting.py b/lighting.py deleted file mode 100644 index d34f023..0000000 --- a/lighting.py +++ /dev/null @@ -1,90 +0,0 @@ -import RPi.GPIO as GPIO # 引入GPIO模块 -import time # 引入time模块 -import jiqiren as jqr - -''' -''' -def L_hcsr_open(): - - GPIO.setmode(GPIO.BCM) # 使用BCM编号方式 - - GPIO.setup(13, GPIO.OUT) # 将GPIO13设置为输出模式 - - # 无限循环 - GPIO.output(13, GPIO.HIGH) # 将GPIO13设置为高电平,点亮LED - -def L_hcsr_close(): - GPIO.output(13, GPIO.LOW) # 将GPIO13设置为低电平,熄灭LED - - GPIO.cleanup(13) # 清理释放GPIO资源,将GPIO复位 - - - -''' -============================================================================================ -以上是关于报警灯光的设计 -============================================================================================ -''' - -def L_living_open(): - - GPIO.setmode(GPIO.BCM) # 使用BCM编号方式 - - GPIO.setup(19, GPIO.OUT) # 将GPIO19设置为输出模式 - - # 无限循环 - GPIO.output(19, GPIO.HIGH) # 将GPIO19设置为高电平,点亮LED - -def L_living_close(): - GPIO.output(19, GPIO.LOW) # 将GPIO19设置为低电平,熄灭LED - - GPIO.cleanup(19) # 清理释放GPIO资源,将GPIO复位 - -''' -============================================================================================ -以上是关于客厅灯光的设计 -============================================================================================ -''' -def L_bed_open(): - - GPIO.setmode(GPIO.BCM) # 使用BCM编号方式 - - GPIO.setup(26, GPIO.OUT) # 将GPIO26设置为输出模式 - - # 无限循环 - GPIO.output(26, GPIO.HIGH) # 将GPIO26设置为高电平,点亮LED - -def L_bed_close(): - GPIO.output(26, GPIO.LOW) # 将GPIO26设置为低电平,熄灭LED - - GPIO.cleanup(26) # 清理释放GPIO资源,将GPIO复位 -''' -============================================================================================ -以上是关于卧室灯光的设计 -============================================================================================ -''' - -def L_control_open(text): - if ("卧室" in text): - L_bed_open() - jqr.Key("已打开卧室灯光") - elif ("客厅" in text): - L_living_open() - jqr.Key("已打开客厅灯光") - elif ("全部" in text or "所有" in text): - L_bed_open() - L_living_open() - jqr.Key("已打开全部灯光") - -def L_control_close(text): - if ("卧室" in text): - L_bed_close() - jqr.Key("已关闭卧室灯光") - elif ("客厅" in text): - L_living_close() - jqr.Key("已关闭客厅灯光") - elif ("全部" in text or "所有" in text): - L_bed_close() - L_living_close() - jqr.Key("已关闭所有灯光") -